S
S
Scratch2015-04-23 11:32:19
MongoDB
Scratch, 2015-04-23 11:32:19

How to quickly select all the followers of a user on the current server?

Hey!
There are several Asp.Net Web.Api servers, each with its own logged in users that can follow each other. Next to each server is its own Redis, which contains the profiles of logged in users (maybe not all), and next to each radish there is a worker who receives tasks to update the caches that are in this radish.
In monge, each user has a complete info on which you can build an entity in a radish, in case it is not there. But you don't want to go there every time.
So, some user has a million followers and he decided to do something there, which should appear for all logged-in followers in the feed. When a worker receives a task, he needs to either

  • Go through all the entities in the radish and see if each has a friend who generated the event. If there are 50-100,000 of them on this server, then this is a bit long
  • Get a list of followers from mongi and calculate the intersection with the data from the radish. This is also slow, because one IDs will be 16 megabytes

And so it goes on slowly. Maybe in radish there is an opportunity to quickly find those entities in which some field is equal to the given one? Need ideas

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AdvanTiSS, 2015-04-23
@AdvanTiSS

If it takes a long time to read the list of followers from mongi, then add the list cache to the radish.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question