Placement looks like the easiest problem in a cache tier: hash the key, find the node, store the value. It stops being easy when one node receives 34 percent more traffic than its neighbours, and the usual answer - more virtual nodes - quietly moves the problem rather than solving it.
A ring, and why it skews
Consistent hashing maps both keys and nodes onto a circular space; a key belongs to the first node clockwise. Virtual nodes let one physical host occupy many positions, which smooths distribution when nodes join or leave. The variance depends on the number of vnodes, not on the number of hosts: with one position per node, standard deviation stays around 30 percent even at 42 nodes.
Our first production ring used 32 vnodes per host and still saw a 1.6x imbalance on one shard because a single high-traffic tenant had keys that clustered on the same arc. Adding vnodes fixed the average and left the hot tenant exactly where it was.
Bounded loads beat perfect placement
Bounded-load hashing changes the rule: compute the two candidate nodes for a key, then assign it to whichever is below the capacity ceiling. If both are full, the key goes to the less loaded one and the ceiling is treated as a soft bound. The result is a formal guarantee that no node exceeds the average load by more than a fixed factor, at the cost of one extra lookup per key.
That trade is easy to justify: the lookup costs microseconds, while a skewed node costs a rebuild. After the switch, the p99 spread across the tier dropped from 1.9x to 1.08x at the same key count.
Rebalancing without a cold cache
Adding a node moves roughly 1/N of the keyspace, which is exactly the set that the new node does not have. If those requests arrive before their data does, the tier forwards all of them to the origin, and the database sees a spike shaped like the rebalance. We move ownership on a budget instead:
- Warm the new node by replaying keys from the origin in batches, while it is not yet receiving live traffic.
- Ramp its weight in steps, moving at most 5 percent of the keyspace per minute.
- Watch origin QPS and p99 during the ramp; pause automatically past a threshold.
Single-flight the misses
Rebalancing is a stampede generator. Every miss for a popular key should collapse into one origin request, otherwise the fix for the hot node becomes an outage at the database. This matters more than the hash function itself.
Done this way, adding a node during peak traffic is a graph that barely moves. The last rebalance moved 1.1 percent of keys per minute, origin QPS rose 4 percent, and no user-visible metric changed.