Answer the question
In order to leave comments, you need to log in
What data structure to choose for storing data in memory?
It is required to store a large number of users (2-3 million). Each user has a set of attributes. For some purposes it is necessary to quickly list users in descending/ascending order of some of the given attributes.
Answer the question
In order to leave comments, you need to log in
Why do it directly in the application? Take, for example, redis.io, and store it in it. There, not only sortedset, but also hash and counterers and a bunch of other things are implemented. It works fast, lies in memory, clusters and shards.
In your case, it would be more convenient to keep your attributes in a sortedset, where the collection name = attribute, and the values are user ids.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question