Tag : database-design

Let’s say I have 100 million users in the database, and each of them have a reward point associated with it. This reward point is eventually consistent. And we need to rank the users based on this reward point. Now, I know how to find top N users who are having most reward points. Basically, we may have a separate datastore to store top N users at any given point. I can use a heap to keep track of top N at any given point and flush it to the DB. But, what if I need to find the rank of a random user (also users who are adjacently ranked to the given user) from 100 million users? We can’t put all 100 million users into memory for sorting. So, how do we achiev..

Read more

Read more