The interview problem
A range-partitioned store has one overloaded partition while other servers are idle. Design an online split that preserves acknowledged writes and routes stale clients safely.
Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.
1. Scope and assumptions
Assume ordered keys, replicated write-ahead logs and a strongly consistent routing directory. Splitting helps only when traffic can be divided across keys; one hot key requires a different strategy.
2. Architecture and decisions
Heat estimate → split point → snapshot and log catch-up → ownership epoch → route update → old-range retirement
Choose a split point using request cost rather than merely key count or bytes. Create child ranges from a consistent snapshot and replay subsequent mutations. The parent remains authoritative during copying. At cutover, use a fenced ownership transition so children cannot accept writes before the parent loses authority. Record the exact log boundary children must contain.
Publish the new routing epoch atomically after the children are ready. A stale request to the parent receives a redirect or a fenced retry response; it must not create a second write path. Preserve operation IDs across retries. Retain the old data until catch-up and verification complete, then reclaim it under a rollback-aware plan.
3. Work through the example
A partition serves 12,000 operations/s; sampled work suggests 70% falls left of the proposed split. Children would receive about 8,400 and 3,600 operations/s. If each target supports 7,000, this split still overloads the left child. A better boundary or additional split is required; halving bytes is not enough.
4. Failure cases and trade-offs
A moving sequential-write hotspot may follow the newest range after every split. One hot key cannot be divided by a range boundary. Copying and replay consume capacity precisely when the parent is busy. Throttle migration, and prefer admission control over an unsafe rushed cutover.
5. Validation and acceptance
Inject writes during snapshotting and failures on both sides of ownership publication. Verify every acknowledged operation survives exactly once at the logical level. Track stale-route retries, catch-up lag and per-child workload after the split.
6. Follow-ups and self-review
How would a range scan crossing the boundary retain snapshot semantics? Reward load-aware boundaries, one write owner, fencing and a clear limit for hot keys.
Sources and related practice
Spanner documents load-based range splitting and pre-splitting; this generic ownership protocol is original.
Read the primary technical reference
Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.
Continue with Move a live tenant between database shards; Distributed Lock System Design: Leases and Fencing.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.