Consistent Hashing in Go — Virtual Nodes & CRC32 Ring

Answer-first: Consistent Hashing minimizes key remapping when cluster membership changes. Adding or removing one node from a modulo-hash cluster remaps nearly all keys (catastrophic cache miss storm). Consistent Hashing remaps only $K/N$ keys — the theoretical minimum necessary. Prerequisite: Part 9 of the System Design Masterclass. Read Part 4: Database Scaling for context on horizontal partitioning strategies. What You’ll Learn That AI Won’t Tell You Virtual Node Standard Deviation: The exact mathematical variance drop when increasing virtual node count ($V$) from 1 to 1000. RWMutex Lock Contention: Why using sync.RWMutex on the hash ring can cause lock contention under high multi-core throughput, and how to optimize with atomic values. CRC32 vs Murmur3: Why the choice of hashing algorithm on the ring impacts lookup distribution uniformity. Why Modulo Hashing Fails When Scaling Key Concept: hash(key) % N changes to hash(key) % (N+1) when a node is added, causing nearly all key-to-node mappings to change. This creates a massive cache miss storm as the entire working set must be reloaded from the database simultaneously. ...

June 18, 2026 · 9 min · Lê Tuấn Anh