Where Consistent Hashing Is Used
Consistent hashing is not an academic curiosity — it is the backbone of some of the most widely deployed distributed systems in production:
Amazon DynamoDB and Apache Cassandra
Both use consistent hashing with virtual nodes to partition data across a cluster. Cassandra's Murmur3Partitioner hashes partition keys onto a 64-bit ring (−2⁶³ to 2⁶³−1). Each node owns multiple token ranges corresponding to its VNodes.
Memcached / Twemproxy
Client-side consistent hashing is used to route cache requests to the correct Memcached node without a central coordinator. Adding a cache node only invalidates ~1/N of cached keys.
Nginx and HAProxy (Load Balancing)
Consistent hashing on client IP or request URI ensures that the same client or resource always routes to the same upstream server — critical for session affinity and cache locality.
Content Delivery Networks (CDNs)
CDNs use consistent hashing to determine which edge node caches a given piece of content, ensuring cache hits without a central lookup.
The Hash Function Matters
The choice of hash function affects both performance and distribution quality:
| Hash Function | Speed | Distribution Quality | Use Case |
|---|---|---|---|
| MD5 | Slow | Good | Legacy systems |
| SHA-1 | Slow | Good | Legacy systems |
| MurmurHash3 | Very fast | Excellent | Cassandra, Redis Cluster |
| xxHash | Fastest | Excellent | High-throughput systems |
| CRC32 | Fast | Moderate | Simple use cases |
Cryptographic hash functions (MD5, SHA-1) are overkill for consistent hashing — you don't need collision resistance, just uniform distribution. MurmurHash3 and xxHash are the modern defaults.