Consistent Hashing
Partition keys across a changing set of nodes with consistent or rendezvous hashing and quantify how much data moves when nodes join or leave.
3 objectives 6 steps about 115 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Implement a hash ring with virtual nodes and measure load balance and key movement when a node is added or removed.
- Compare modulo, ring, rendezvous and jump hashing by balance, key movement and lookup cost.
- Apply consistent hashing to a cache cluster or partitioned store, including replica placement on the ring.
Lesson plan
6 steps, about 115 min · 5 of 5 lessons available so far
- Why hash mod N breaks when the cluster changes Concept · 15 min
- The ring, virtual nodes and replica placement Concept · 20 min
- Implementing and measuring a hash ring Lab · 30 min
- Rendezvous and jump hashing Concept · 15 min
- Rings in practice: cache clients and Dynamo-style stores Worked example · 20 min
- Consistent hashing check Knowledge check · 6 questions
Practise it
Implement modulo and ring hashing with configurable virtual nodes, place 1M keys on 10 nodes, and report the load standard deviation and the fraction of keys moved when an eleventh node joins, for 1, 50 and 200 virtual nodes.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own CDNAdvanced · 10–20 h
References
Hard prerequisites
None.
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.