Grokking Redis
0% completed
2.7 Sorted Sets
Nothing in a sorted set is sorted at the moment you read it. The structure stays in order on every write, so "the top ten," "who is ranked 5,000th," and "everything between 9:00 and 10:00" are all cheap queries that never sort anything.
A sorted set is a collection of unique members in which each member is paired with a numeric score, and the members are always kept ordered by score. This one idea supports leaderboards, priority queues, schedulers, sliding window rate limiters, and time-based indexes, which is why many engineers consider it the most versatile structure in Redis
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%