7.4
Distributed Systems

Consistent Hashing

Hash ring, key assignment, minimal redistribution on node changes, and virtual nodes for load balancing

Presets
1.0x
0%25%50%75%Hash Ring0 ... 2^32
Metrics
Nodes
0
Keys
0
Min Keys
0
Max Keys
0
Avg Keys
0
Redistributed
0
Event Log0
Press Play or add nodes/keys
How It Works

Hash Ring: Both servers and keys are hashed onto a circular ring (0 to 2^32). Each key is assigned to the first server found clockwise from its hash position.

Minimal Redistribution: Adding or removing a node only affects keys between it and its counter-clockwise predecessor. Other keys stay on their current node.

Virtual Nodes: Each physical server maps to multiple ring positions, improving load balance and reducing hotspots. With N virtual nodes, each server owns N arcs on the ring.

Real-World Usage: Used by Amazon DynamoDB, Apache Cassandra, Discord, and Akamai CDN for distributing data across cluster nodes.