← BACK TO KNOWLEDGE

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

  1. 01Modulo hashing moves too many keys
  2. 02The ring maps keys and nodes
  3. 03Virtual nodes improve balance
01

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
02

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
03

Tradeoffs

Consistent hashing reduces movement but adds membership, balancing, and hotspot concerns that still require measurement.