Consistent Hashing Cheat Sheet
Key concepts, trade-offs, and quick-reference notes for your interview prep.
Modular Hashing Trap: hash % N Reshuffles 99%
#1💡 hash % N remaps 99% on node change. Ring remaps 1/N = 1%.
Virtual Nodes: 256 Per Server Reduces Variance to <10%
#2💡 256 vnodes/server. 25,600 total positions. <10% variance.
Ring Lookup: O(log N) Binary Search on 307 KB
#3💡 307 KB ring, 15 comparisons, 15 nanoseconds. Fits in L2 cache.
Rebalancing Cost: 5 GB Transfer in 42 Seconds
#4💡 5 GB per node add. 42 seconds at 1 Gbps. Two-phase bootstrap.
Replication Placement: Walk N Distinct Physical Nodes Clockwise
#5💡 Walk clockwise, skip same-physical-node vnodes, collect RF distinct hosts.
Hot Key Splitting: Scatter into 10 Sub-Keys
#6💡 10 sub-keys. Random suffix on reads. Detect via CPU divergence.
Jump Hash vs Ring: Zero Memory but No Arbitrary Removal
#7💡 Jump hash: O(ln N), 0 memory, perfect distribution, no arbitrary removal. Ring: 307 KB, arbitrary removal.
Bounded Load: Cap at (1+epsilon) x Average
#8💡 Cap at (1+epsilon) x average. epsilon=0.25 means max 125%. Dynamic routing reduces hits by 2-5%.
Ring Convergence: Versioned Epochs with 5-Second Poll
#9💡 Epoch numbers. 5-second poll. 10-second convergence. 307 KB full ring pull.
Cache Miss Storm: Request Coalescing + Circuit Breaker
#10💡 Coalesce concurrent misses. Circuit breaker at 10x miss rate. Staggered TTLs with jitter.