Closed robertomiranda closed 9 years ago
another thing is what about the historically data? is there's a way to expire them from memory and save it on disk? I couldn't imagine a full year weekly ranking loaded in memory
The naming approach seems fine.
If you want to preserve the leaderboard data, but not have it take up memory, you'd have to save the dataset to disk by issuing one of the commands to persist to disk such as BGSAVE. At that point, you'd want to preserve the Redis database (probably .rdb) by copying it from the Redis DB save location and then you could clean up or remove the historical data from the CLI. The drawback is that you lose the ability to pull up that historical data.
It's also relatively straightforward to assess how much memory would be taken up with a leaderboard(s). See https://github.com/agoragames/leaderboard/#performance-metrics for some approaches. You might want to look at bulk insert.
@czarneckid thanks, about the historical data how about after call BGSAVE save it in a relational database like Postgres using the JSON or HSTORE?. And if necessary to make some operations can load it back in Redis again, though that would be an unusual case
just came to my mind something like create a leader board per week?
cc:// @czarneckid