Try
↑ ↓ move↵ openesc close

Interview prep / Partitioning

Senior · Partitioning · System design interview question

How and when would you split a hot range partition, what split point do you pick, and where does splitting stop helping?

Sketch your own answer first, then compare it with the one below.

A strong answer

Split when a partition is too large or too busy, based on size, on request load, or on a sustained imbalance against its neighbours. The split divides one range into two and the halves can move to different machines.

The best split point is where half of the load lies below it, which needs per-key or per-bucket load statistics. Splitting at the middle of the key range or at the median of the stored bytes can leave the traffic lopsided. A split is not free. Data has to move or at least be re-owned, metadata must change atomically, and the partition being split is by definition busy.

It stops helping in two cases. If the hot partition is one key, there is nothing to cut. And with sequential keys, the split only divides old data. Every new key is larger than the split point, so the new upper half takes all the writes and the hot spot simply moves with it. For those, change the key or the partitioning rule.

In practice splits and merges are automated and rate-limited, so a burst of splits does not swamp the cluster.

Sources

Learn it by running it

The partitioning lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms