The interview problem
Design storage for 100 PB of immutable analytical objects, mostly large sequential reads. Compare triple replication with a 6+3 erasure code across 12 racks. Explain when a write is durable, how reads work during failures, and how repair avoids corrupting a newer object or resurrecting a deleted one.
Original system-design practice, not a reported interview. Architecture and calculations are original. Primary technical documentation retrieved September 27, 2026; interview date not applicable.
1. Specify the code and its guarantee
Choose a systematic Reed–Solomon code with six data fragments and three parity fragments per stripe. “Systematic” means the original data fragments remain directly readable. The chosen maximum-distance-separable code can reconstruct a stripe from any six valid fragments of the same generation and coding geometry.
A full 6 MiB logical stripe produces six 1 MiB data fragments and three 1 MiB parity fragments. Its payload occupies 9 MiB. Up to three known fragment erasures are tolerable; four missing fragments can leave too little information.
This guarantee assumes the remaining fragments are valid. Detect corruption with checksums tied to trusted metadata, and treat detected bad fragments as unavailable. Do not equate tolerating known erasures with tolerating the same number of arbitrary undetected corruptions.
Objects contain many stripes, and every required stripe must remain recoverable. Metadata availability, authorization and routing are separate requirements. Erasure coding does not restore a lost manifest or undo a user-authorized deletion.
2. Compare capacity using consistent denominators
coded payload amplification = (6 + 3) / 6 = 1.5 100 PB logical → 150 PB coded payload 100 PB logical → 300 PB with three full copies saving relative to triple replication = (300 − 150) / 300 = 50%
The coding overhead is 50% of logical size. The saving is 50% relative to triple replication. Those percentages use different denominators; neither means the data occupies half of one original copy.
At a hypothetical maximum steady-state occupancy of 70%:
coded raw capacity = 150 / 0.70 ≈ 214.29 PB replicated raw capacity = 300 / 0.70 ≈ 428.57 PB
These decimal-PB estimates exclude metadata and implementation overhead. The stripe example uses binary MiB explicitly. Check padding, checksums, fragment allocation and repair headroom in the actual implementation. Tiny objects may have much worse amplification than the full-stripe ratio.
Do not infer equivalent durability from capacity alone. Three replicas and a 6+3 code tolerate different fragment-loss patterns and impose different repair costs. Failure correlation, detection delay, repair time and metadata protection determine the practical risk.
3. Place fragments by failure domain
Place each stripe's nine fragments in nine distinct racks selected from the 12. A rack failure then removes at most one fragment from each stripe. Three rack failures still leave at least six fragments, provided no additional failures or corruption affect the survivors.
| Placement | Failure | Consequence for an affected stripe |
|---|---|---|
| One fragment in each of nine racks | Three selected racks lost | Six fragments remain; decoding possible |
| One fragment in each of nine racks | Four selected racks lost | Five remain; decoding not guaranteed |
| Three fragments in each of three racks | One rack lost | Six remain; entire erasure budget consumed |
| Three fragments in each of three racks | Two racks lost | Only three remain; insufficient |
The three racks not selected for a particular stripe provide possible repair destinations, subject to capacity and placement rules. They need not be idle racks globally. Rebuilding after a failure requires enough space in suitable surviving domains, not merely enough aggregate free bytes somewhere.
If a power or network domain spans four selected racks, one correlated event can defeat the rack-level design. Model the actual hierarchy of disks, hosts, racks and zones. A topology label is useful only if it represents real shared failure causes.
4. Publish immutable generations
object write → generation allocator → stripe encoder
↓
nine fragment destinations
↓
durability and checksum acknowledgements
↓
atomic object-manifest publication
↓
readers and background repair schedulerThe manifest identifies object generation, logical length, stripe layout, code version, padding, fragment identifiers, locations and integrity information. Store this control metadata durably using a separately protected service.
For the worked design, acknowledge success only after all nine fragments of every stripe are durably stored in the required failure domains and the manifest is committed. At acknowledgement, this preserves the full three-fragment erasure budget, assuming no already-known loss.
Committing after only six fragments would make the object decodable at that moment but leave no additional fragment-loss margin for those stripes. A design may explicitly choose weaker durability during asynchronous parity completion, but must not advertise it as the same acknowledgement contract.
Use a stable request identifier so client retries find the same committed generation rather than creating unintended duplicate writes. Failed attempts can leave unreferenced fragments. Garbage collection needs authoritative manifest references and protection for active uploads, not immediate deletion of anything temporarily unlisted.
5. Read directly when healthy and decode when degraded
Healthy range reads fetch the relevant systematic data fragments. Validate their checksums and generation. If a required fragment is unavailable or corrupt, obtain enough compatible surviving fragments to reconstruct the requested data.
Bound hedged reads and retry fan-out. Asking every destination repeatedly can turn a single slow rack into cluster-wide overload. Distinguish a temporarily slow fragment from a confirmed failed device before scheduling extensive repair.
Never mix fragments from different object generations or code parameters. A decoder may produce bytes from incompatible inputs without those bytes representing the requested object. Verify reconstructed data against integrity metadata before returning it or publishing a repair.
If a requested data fragment is missing and fewer than six valid fragments remain for its stripe, fail reconstruction clearly and investigate an independent copy or backup where one exists. An intact systematic fragment can still serve its own verified range, but that does not make the whole stripe recoverable. Returning zeros or partial unmarked content would convert an availability failure into silent corruption.
6. Budget repair traffic rather than only storage
For a conventional full-fragment Reed–Solomon reconstruction, repairing one missing 1 MiB fragment reads six surviving 1 MiB fragments and writes one replacement. This is an explicit baseline algorithm, not a universal lower bound for all erasure codes.
Suppose a failed device held 10 TB of actual fragment data across many stripes, with one missing fragment per affected stripe:
survivor reads = 6 × 10 TB = 60 TB replacement writes = 10 TB total repair I/O = 70 TB at a shared effective 10 GB/s aggregate repair limit: 70,000 GB / 10 GB/s = 7,000 seconds ≈ 1.94 hours
This is a lower bound under the stated decimal units and shared read-plus-write limit. It excludes decoding, seek costs, scheduling and foreground competition. With independent read and write bottlenecks and full overlap, use the larger of their service times instead of summing them.
The 10 TB is lost fragment payload, not 10 TB of logical objects. If several fragments of one stripe are missing, a repair may decode once and generate multiple replacements; blindly multiplying the six-read cost per missing fragment can overstate work.
Locally repairable codes can reduce the number of survivors needed for some repairs, with different parity layouts and guarantees. Compare their storage, placement and repair properties explicitly rather than transferring the “any six of nine” guarantee to a different code.
Prioritize stripes with the least remaining redundancy, while enforcing tenant fairness and reserving bandwidth for foreground traffic. Faster repair reduces the period of vulnerability, but unlimited repair concurrency can make healthy reads fail and overload the remaining disks.
7. Fence repair against updates and deletion
A repair task records the object generation, stripe and placement version it is repairing. It writes a replacement into an immutable namespace and verifies it before proposing a location update.
- A repair begins for generation G after one fragment disappears.
- A client publishes a new object generation G+1, or commits a deletion tombstone.
- The old repair finishes writing a fragment for G.
- A conditional metadata update checks the generation's current lifecycle state and placement version. It cannot replace the current G+1 pointer or override the deletion.
- If G remains legitimately retained, its own manifest may receive the repair. Otherwise the new fragment becomes eligible for reference-aware cleanup.
A repair lease limits duplicate work, but lease ownership alone is not the correctness rule. The publication check must validate current authoritative state. A stale worker must not resurrect an object simply because it still has fragments.
During rebalancing, copy and verify a replacement, publish its location safely, then retire the old copy after readers are protected. Preserve failure-domain separation throughout the transition. Temporarily moving several fragments into one rack can undermine the guarantee even if the eventual plan looks correct.
8. Choose where coding belongs
Large immutable objects make full-stripe encoding straightforward. Small hot objects may remain replicated for latency and operational simplicity. Packing small objects into coded containers can reduce padding but introduces indexing, deletion and compaction work.
In-place partial updates require a separate parity-consistency protocol; this design avoids that by creating immutable generations. Caches can improve hot reads, but a cache must not become an undocumented durability dependency.
Separate local fragment protection from disaster recovery. A second region or an offline backup protects against different failures and adds cost. Do not claim durability “nines” by applying an independent disk-loss formula without accounting for shared failures and the repair window.
Monitor degraded stripes by remaining valid fragment count, repair backlog age, repair bandwidth, checksum failures, free capacity per domain and foreground latency. Total free storage and average repair time can hide the most vulnerable stripes.
Failure analysis and self-review
Exercise every combination of up to three missing fragments in a stripe, detected corruption, failed manifest publication, coordinator recovery, an old repair completing after deletion, and rebalance interruptions. Intentionally test four relevant losses to verify explicit failure rather than silent output. Measure repair throughput under foreground load.
- Nine fragments share three racks: count correlated losses, not fragment count alone.
- Writes acknowledge six fragments but promise three-loss tolerance: align acknowledgement with the stated durability budget.
- Repair saturates surviving disks: enforce resource limits and redundancy-aware priority.
- A stale repair republishes old data: condition publication on generation and lifecycle state.
- Storage savings ignore tiny objects: measure allocation and padding at real size distributions.
Follow-ups: How would you support mutable blocks? What happens when a rack is down during a new write? Can local repair reduce cross-rack traffic? How should repair priority change after a second failure? Which metadata must survive to decode abandoned fragments?
A strong answer connects code geometry, physical placement and acknowledgement semantics. An excellent answer quantifies repair cost, handles concurrent lifecycle changes and distinguishes mathematical recoverability from operational availability and durability.
Count correlated failures before promising recovery
Additional original practice exercise · October 3, 2026. Numbers are illustrative assumptions.
For the hypothetical 6+3 code, decoding requires six valid fragments out of nine. Place three fragments in each of three racks: losing one rack leaves six, so mathematical reconstruction remains possible, but there is no remaining fragment-loss margin. One additional unavailable fragment makes the object unreadable until a fragment returns or is recovered elsewhere.
Place one fragment per rack across nine racks and the same code can tolerate three whole-rack losses, assuming the metadata and network needed for reads remain available. Both layouts have nominal 1.5× payload storage amplification. Equal storage overhead does not imply equal resilience to correlated failures.
Practice: a repair plan temporarily places two fragments in one rack. Re-evaluate the failure guarantee during the transition, not only after rebalancing completes. Do not translate this example into a durability probability without a failure model and measured repair exposure.
Related practice: Reclaim unreferenced blobs safely · Design a GPU job scheduler
Sources and attribution
- Ceph Tentacle: Erasure code — coding parameters, storage amplification and failure-domain context.
- Ceph Tentacle: Locally repairable erasure code plugin — alternative repair layouts and reduced repair fan-in.
Retrieved September 27, 2026; exact page publication dates unstated. The 6+3 scenario, capacity estimates, acknowledgement policy and repair-publication protocol are original practice, not a description of Ceph's exact implementation or a reported company interview.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.