Datahot spothotspothot shardskew

Hot partition

Definition

A hot partition is a partition overloaded because its keys attract a disproportionate share of reads or writes, through a skewed key, a popular entity or a monotonic key.

In practice

Partitioning spreads keys, not load. One celebrity account, a viral product, a busy city cell in a ride-sharing index or a Kafka topic keyed by a dominant tenant all land on a single partition. Sequential keys under range partitioning push every new write to the last partition. The cluster looks under-used on average while that partition throttles or times out.

Adding partitions does not split a single key. Fixes are salting the key (key#0 to key#9) at the cost of fan-out reads, caching hot reads, choosing a higher-cardinality key, or splitting a hot range. Monitor per-partition load, because cluster averages hide it.

Example

A sharded counter keyed by event_id puts all 40,000 votes per second for a final match on one shard capped at 5,000 writes per second; splitting it into 16 salted sub-keys spreads the load.