Consistent Hashing

A hashing technique that maps keys and nodes (servers) onto a common ring so that the addition or removal of a node only remaps a small fraction of keys, enabling scalable and stable distributed storage and caching.

Method

Hash nodes and keys onto a circle; each key is assigned to the first node encountered clockwise (or via virtual nodes for balance). Adding/removing a node only affects the arc between its neighbors. Virtual nodes improve load balance. Used in Dynamo-style systems, CDNs, and distributed hash tables.

Applications

Distributed key-value stores, content delivery networks, load balancing, distributed caching (memcached-style), peer-to-peer systems, sharded databases.

Advantages

Minimal key redistribution on membership change; simple and elegant; supports incremental scalability; widely adopted in production systems.

Limitations

Load imbalance without virtual nodes or careful design; does not by itself handle heterogeneous node capacities or complex replication; network partitions require additional membership and consistency protocols.

Alternatives

Rendezvous hashing (HRW), ordinary modular hashing (with full remap), jump consistent hash, range partitioning, directory-based schemes.

Sources

Educational reference only, not professional advice.

All algorithms