KNOWLEDGE / System Design / Distributed Systems
Consistent Hashing from First Principles
Why a hash ring limits key movement when distributed cache nodes change.
System DesignDistributed SystemsCaching
- DOMAIN
- System Design
- LEVEL
- Advanced
- READ
- 7 min
- UPDATED
- Aug 9, 2026
MENTAL MODEL / KEY IDEAS
Keep these in mind
- 01Modulo hashing moves too many keys
- 02The ring maps keys and nodes
- 03Virtual nodes improve balance
The reshuffling problem
With modulo hashing, changing the node count changes most assignments. That creates a cold-cache event during scaling.
- Node churn
- Cache misses
- Downstream load
The ring
Keys and nodes share a circular hash space. A key belongs to the next node clockwise, so only neighboring ranges move when membership changes.
- Stable range ownership
- Virtual nodes
- Replication positions
Tradeoffs
Consistent hashing reduces movement but adds membership, balancing, and hotspot concerns that still require measurement.