3 ms·
I'd calculate some ranking, every X seconds, keep it in a cache of some sort, and page from that. They do seem to persist it permanently too, because you can go
by verdverm 7y ago
I'd calculate some ranking, every X seconds, keep it in a cache of some sort, and page from that. They do seem to persist it permanently too, because you can go view the top list on a given day.
Also notice new works like traditional cursor paging, while the front/main thread ranks like you describe.
The hiding feature is another interesting one to think about w.r.t. paging.
Have you inspected the network requests and responses?
- o____o 7y agoOmg you just got me thinking! I am already planning on using Redis for this board. What I could do is keep 1 main copy of my leaderboard, that is used mainly for writes, then I also keep other copies of the leaderboard but in snapshots of previous 30 seconds, 1 minute, 1:30 etc. This way depending on when you first queried for the initial page, you access copy of the leaderboard at X time. One edge case I'm not sure about is what I should do if user has a pointer to a very old copy of the leaderboard, lets say >30 minutes or >1 hour, it would be kind of expensive to keep so many copies (or maybe not?).