Grokking Redis
0% completed
5.1 Leaderboards with Sorted Sets
A leaderboard is a list of players ordered by score, and it must answer three questions quickly: who is in the top ten, what is my rank, and which players are just above and below me. A relational database answers these questions by sorting or counting rows, so each query gets slower as the number of players grows. A Redis sorted set keeps its members in score order at all times. Every update moves one entry to its new position, and every query reads a structure that is already sorted, which is why leaderboards are the standard use of sorted sets.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%