What is Erasure Coding and How Does It Achieve High Durability?
Why Not Just Replicate?
Simple replication stores 3 copies of every byte. To survive 2 failures, you need 3x storage overhead. Erasure coding achieves the same durability with 1.4x overhead. For petabyte scale storage, this difference saves millions of dollars annually in disk costs.
The math enables this efficiency. A 10+4 erasure coding scheme (called Reed Solomon coding) splits data into 10 data fragments and generates 4 parity fragments. Storing 14 fragments protects against losing any 4. Compared to 3x replication, you store 14 units instead of 30 units for the same 10 units of data.
How Reconstruction Works
Each parity fragment encodes information about all data fragments using polynomial math. Think of solving simultaneous equations: 10 unknowns need 10 equations. Any 10 fragments (data or parity) provide 10 equations, letting you solve for the original data. Lose 4 fragments? The remaining 10 still solve the system.
This is not compression or encryption. Every fragment is the same size as the data fragments. The magic is in the mathematical relationship between fragments, not in reducing data size.
Durability Calculation
Durability depends on fragment failure probability and reconstruction speed. If each disk has 1% annual failure rate and you tolerate 4 failures, losing all 5 of 14 fragments has probability roughly (0.01)^5 = 0.0000000001. That is eleven nines durability: 99.999999999%.
But this assumes failures are independent and repairs are instant. Correlated failures (entire rack loses power) and slow repairs reduce effective durability. Real systems add geographic distribution to ensure independence.