Notespartitioning🌱 seedling
Hot Spot
Also: Hot Key · Hot Partition · Hot Shard · Skewed Workload · Key Salting · Write Sharding · Celebrity Problem
A shard that gets far more than its share of traffic, usually because one key (or one key range) is far more popular than the rest. Hashing spreads keys, not load, so it can't fix a single hot key.
Why it exists
Real workloads are skewed: a celebrity's post, a viral video, one huge tenant, or every insert going to the newest range under Range Partitioning. All requests for one key must go to the shard that owns it.
How it works
- Key salting / write sharding: append a suffix (
key#0…key#9) so writes for one logical key spread over several shards; reads fetch all sub-keys and combine. - Split for heat: move a hot range onto its own partition by splitting at a key chosen from observed traffic.
- Absorb reads: cache the hot value, or coalesce concurrent identical reads into one query.
- Isolate: give a big tenant its own shard.
Trade-offs
| Fix | Cost |
|---|---|
| salting | every read fans out to all sub-keys; you must track which keys are salted |
| load-based splits | can't split one key; sequential access gains nothing |
| caching / coalescing | staleness; only helps reads |
In practice
- DynamoDB partitions are designed for 3,000 reads and 1,000 writes per second each; it splits partitions on consumption but deliberately doesn't split for a single hot item or sequential key access.
- Discord saw hot channels slow down whole Cassandra nodes, and quorum reads spread the latency to unrelated queries; data services with request coalescing contained it.
Pitfalls
- Adding shards to fix a hot key: the key still lives on one of them.
- Salting every key "just in case": every read becomes a fan-out.
Connections
Recall
These cards are also in your review deck, scheduled with spaced repetition.