SD System Design In Depth
0%
lesson system-designobject-storage

Durability and replication

Module 2.3: Storage Engine Internals & Blob Systems Updated Sep 17, 2026
📄 Cheat Sheet
AWS re:Invent 2022 - Beyond 11 9s of durability: Data protection with Amazon S3 (STG338)
AWS Events AWS re:Invent 2022 - Beyond 11 9s of durability: Data protection with Amazon S3 (STG338) Watch on YouTube ↗

AWS's own re:Invent session on how S3 reaches and goes beyond 11 nines: failure-domain placement, repair, and the human and software processes that durability actually depends on.

0:00 / --:--

Under the Hood: 11 9s Durability & Reed-Solomon Erasure Coding

Achieving 99.999999999% (11 9s) annual durability means that if you store 10,000,000 objects, you can expect to lose a single object once every 10,000 years. Physical hard drives have an Annualized Failure Rate (AFR) of 1% to 4%. To survive constant disk, server, and datacenter failures at scale, storage architectures transition from simple replication to Reed-Solomon Erasure Coding.

Replication (3x) vs Erasure Coding (8+4)

flowchart TD subgraph Rep ["3-Way Replication (3x Storage, 200% Overhead)"] Data["Original 100MB Blob"] --> R1["Copy 1 (100MB)"] Data --> R2["Copy 2 (100MB)"] Data --> R3["Copy 3 (100MB)"] Note1["Total Storage: 300MB. Can survive 2 disk failures."] end subgraph EC ["Reed-Solomon 8+4 Erasure Coding (1.5x Storage, 50% Overhead)"] ECData["Original 100MB Blob"] --> Split["Split into 8 Data Chunks (12.5MB each)"] Split --> Parity["Generate 4 Parity Chunks via Galois Field Matrix Math"] Parity --> Distribute["Distribute 12 chunks across independent failure domains"] Note2["Total Storage: 150MB. Can survive ANY 4 lost fragments (4 disk or rack failures if each fragment is in its own failure domain)"] end

Under the Hood: Erasure Coding Math

An RS(k, m) scheme splits an object into k data fragments and generates m parity fragments using matrix multiplication over Galois finite fields GF(2w):

  • Storage Overhead: (k + m)/k. For RS(8, 4), the overhead is 12/8 = 1.5× (50% storage overhead), compared to 3.0× (200% overhead) for 3-way replication.
  • Fault Tolerance: The system can reconstruct the entire original object from any k surviving fragments out of the total k + m fragments. In an RS(8, 4) cluster, the code can tolerate any four unavailable fragments. Real durability also depends on placing fragments in independent failure domains, detecting corruption, repairing before additional losses, and keeping metadata recoverable.

Worked example: how often do disks fail?

A cluster of 10,000 drives with a 2% annualized failure rate loses about 200 drives per year, one every 1.8 days. If each drive holds 16 TB and repair runs at 200 MB/s per drive rebuilt, rebuilding one drive's data serially takes about 22 hours. Real systems rebuild in parallel from many peers, so a drive's contents are re-protected in minutes to hours. The shorter that window, the less likely additional failures overlap it.

Replication and erasure codes compared

SchemeStorage overheadLosses toleratedRepair reads per lost fragmentUsed by
3-way replication3.0x21 copyHDFS default, many databases
RS(6,3)1.5x36 fragmentsHDFS erasure coding policy
RS(10,4)1.4x410 fragmentsFacebook HDFS warehouse
RS(17,3)about 1.18x317 fragmentsBackblaze Vaults
LRC(12,2,2)about 1.33xAny 3, plus many 4-failure patterns6 fragments for a single lossAzure Storage

The repair column is the hidden cost: rebuilding one lost fragment in RS(10,4) reads ten fragments across the network. Local Reconstruction Codes add local parities so the common single-failure case reads fewer fragments.

What 11 nines really means

AWS phrases it as: store 10 million objects and you can expect, on average, to lose one object every 10,000 years. That design target assumes independent failure domains (S3 Standard spreads data across at least three Availability Zones), continuous integrity checking, and fast repair. It does not protect against a user deleting their own data; versioning, Object Lock and replication to another region address that.

Failure modes

  • Correlated failures: a firmware bug or bad batch of drives hitting many disks at once.
  • Repair storms: a rack loss triggers massive rebuild traffic that competes with user traffic; systems throttle and prioritize the most at-risk objects.
  • Silent corruption: without checksums and scrubbing, a fragment can be bad long before you need it.
Check yourself Question 1 of 3
RS overhead and tolerance recall
From: Under the Hood: Erasure Coding Math

For a Reed-Solomon RS(12, 4) code, what are the storage overhead and the number of lost fragments it can tolerate?

Key Takeaways

3-way replication incurs a 200% storage overhead and survives 2 drive failures.
Reed-Solomon Erasure Coding (e.g. 8+4) reduces storage overhead to 50% while surviving any 4 lost fragments, which means 4 rack or drive failures only when each of the 12 fragments sits in a separate rack or drive.
Galois field matrix math allows perfect reconstruction of data from any k surviving chunks.
Was this lesson helpful? Spot an issue or have a suggestion? Let us know on GitHub.
Report an issue