Cards/Distributed DataSystem Design · Day 34Sep 3, 2026

Evenly Distributed Isn't Even

Ten shards holding ten percent of the data each while one hot key sends sixty percent of traffic to shard four, and the three fixes — cache in front, split the key artificially, replicate the hot ones

You hashed the key. The data spread perfectly. Ten shards, ten percent each.

Then one celebrity posts, one product goes viral, one enterprise customer signs up — and sixty percent of your traffic lands on shard four.

Data per shard is still even. Requests per shard now follow a power law. Hashing distributes keys and cannot distribute popularity, because popularity was never in the key.

Resharding does not rescue you either. The hot key is a single value, and a single value cannot be split by definition.

Three things actually work. Cache in front — a hot key is a cache's favourite thing. Split the key artificially, so post_123 becomes post_123:0 through :9, spread across shards and summed on read. Replicate just the hot ones, making the popular key available everywhere.

Note the second one. You deliberately break your own clean scheme for a handful of keys — uniform rules, non-uniform world.

Systems are designed for the average case and destroyed by the exceptional one.

Hashing distributes keys and cannot distribute popularity, because popularity was never in the key.