Answer the question
In order to leave comments, you need to log in
Data in postgres counters in redis, how to filter?
Greetings.
The question of how this case is conceptually solved keeps me awake.
The situation is quite typical, the data (for example, a list of movies) is stored in a relational database (for example, postgresql), and statistics / counters in redis (or memcache), what if I want to select the most watched movies (the number of views is in redis) whose name begins with "kill" (the names are stored in postgresql).
How are such cases handled?
By adding a layer like sphinx/elasticsearch or something else?
Answer the question
In order to leave comments, you need to log in
store counters in a relational database, what's the problem?
if you have less than 10 million users a day, even one database instance will pull such a load, why the garden in this case is not very clear, you can simply aggregate likes and views and later put them in the database to insert them less often.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question