Concept Flow - List vs sorted set for sequences
Start
Choose data structure
List
Add elements at ends
Retrieve by index
Order is insertion order
Sorted Set
Add elements with scores
Retrieve by score or rank
Order by score
Unique elements only
You start by choosing either a List or a Sorted Set to store sequences. Lists keep order by insertion and allow duplicates. Sorted Sets store unique elements with scores that define order.