A list preserves b, a, b as three positions; a sorted set orders unique a and b by scores 10 and 20.

Positions versus scores: schematic.

A Redis list and a sorted set solve different problems

A Redis list stores an ordered sequence that permits repeated values. A sorted set stores unique members ordered by numeric scores. The useful distinction is not that one is universally faster or cheaper: it is whether the application needs positional sequence operations, unique membership, score ranges, or a combination requiring a different data model. ...

January 4, 2028 · 7 min · XB Field Notes