Q19 · How do you approach hot partition problems?

Back to 24 Architecture Questions.

The question is not “rebalance harder”. The axis it turns on: whether the hotspot is a key, a tenant, or a time window. The three shapes have different causes and different fixes; the expensive mistake is applying one fix to all three, or adding nodes when the problem is that nothing spreads.

Diagnose the shape first A hot partition is diagnosed as one of three shapes: a hot key, fixed by sharding and merging; a hot tenant, fixed by isolation; or a hot time window, fixed by salting the buckets. FIGURE 19 DIAGNOSE THE SHAPE FIRST Hot Partition diagnose the shape Hot Key fix: shard + merge Hot Tenant fix: isolate by tier Hot Window fix: salt the buckets a key is scattered, a tenant is isolated, a window is salted; adding nodes spreads none of them

What the answer should contain

Diagnose before fixing, because the fixes are not interchangeable. A key hotspot means one item absorbs the traffic; a tenant hotspot means one customer outgrew their slice; a time-window hotspot means the current bucket takes all the writes. Monitor per-partition load and alert on skew (max/mean), because the average is exactly the number that looks fine while one partition burns.

Hot key: scatter and merge. Split the hot key into N subkeys (salted), read all N in parallel and merge, and the load spreads across partitions. Cheaper for read-hot keys: cache the celebrity, or add read-only replicas of that item. The scatter trick is for write-hot keys, where no cache saves you.

Hot tenant: isolate by tier. One large customer should not share partitions with the long tail: move them to dedicated shards, give noisy neighbors quotas, and let the tiering be explicit so the next large customer is a routing change, not an incident. The customer usually pays for their tier; make the isolation a feature.

Hot window: accept, provision, or salt. In time-partitioned data the newest bucket is always the hottest; that is normal and needs headroom, plus hot/cold tiering so old partitions stop costing. A pathological spike (a flash event landing in one minute) is salted like a hot key: write to N sub-buckets of the current window and merge on read.

Re-keying is the last resort with a plan. If the partition key itself is the defect (low cardinality, bad hash input), re-keying means a migration: dual-write or backfill, consistent hashing to limit the blast radius, and a rollback. Choose keys with the traffic shape in mind from the start: high cardinality, stable under the real query patterns.

Ideas worth mentioning out loud

Follow-ups to expect

Red flags in an answer

Sources