liveBook · Manning

Ordered set

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A sorted set is a collection of unique members maintained in order according to an associated score or ordering value.

A sorted set stores unique members in score order. Redis orders entries automatically when they are inserted, making sorted sets useful for fast leaderboard reads. section 11.0

Game leaderboard

Store player scores in a Redis sorted set to serve leaderboard reads from memory instead of repeatedly querying and sorting the relational database. section 11.0

ZREVRANGE "player-scores" 0 9

This Redis command shows a range query against the player-scores leaderboard. section 11.0

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains automatic score-based ordering and fast retrieval, but not sorted-set internals.
Examples
Uses a mobile-game leaderboard of player scores and ranks as its concrete example.
What you can do after
Apply a Redis sorted set to keep game scores ordered and retrieve leaderboard data from memory.
How it connects
Connects sorted sets with Redis, in-memory caching, relational databases, and leaderboard ranking.

Also explained in

Compare how 3 books explain ordered set →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.