beginnerRedis — Data Structures, Persistence & Pub/Sub
What is a Redis Sorted Set and what are its use cases?
A Sorted Set is a collection of unique elements, each associated with a floating-point score. Elements are ordered by score. Operations: ZADD (add), ZRANGE (by rank), ZRANGEBYSCORE (by score), ZREVRANGE (reverse order), ZINCRBY (increment score), ZRANK (get rank). Time complexity: O(log N) for most operations. Use cases: 1) Leaderboards: ZADD game:scores 1500 'alice'; ZREVRANGE game:scores 0 9 (to
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
What is a Redis Sorted Set and what are its use cases?