Storage Fundamentals Series

🧩 Understanding Erasure Coding From a Top 1% Perspective — RAID 5/6's Parity Idea, Generalized Into a Freer Ratio, Spread Across Multiple Nodes

Introduction

This article is part of the Top 1% Series Complete Article Guide, and article 6.2 in the Storage Series.

Prerequisite Knowledge

Getting the Big Picture

RAID 5 tolerates one disk failure with one parity, and RAID 6 tolerates two disk failures with two parities — a fixed ratio. Erasure coding generalizes this “data-to-parity ratio” into any ratio at all, expressed as k data chunks to m parity chunks. In a configuration like RS(10,4), for example, you can lose any 4 out of the 14 total chunks (10 data chunks plus 4 parity chunks) and still recover the original data. And where RAID stayed entirely contained within a single disk array, erasure coding typically spreads its chunks across multiple nodes in a distributed cluster.

graph TB
    RAID["RAID 5/6<br/>(fixed ratio, within a single array)"] --> EC["Generalization into erasure coding"]
    EC --> Flexible["k data chunks + m parity chunks<br/>(any ratio)"]
    EC --> Distributed["Spread across multiple nodes in a distributed cluster"]
    Distributed --> Tolerance["Survives node loss and site loss too"]

Deep Dive Into the Fundamentals

Why Erasure Coding Is More Capacity-Efficient Than Replication

Simple triple replication, copying the same data to three nodes, needs 3x the original data’s capacity to survive two failures. An erasure-coded configuration with equivalent durability often needs only about 1.4x to 1.6x the original data’s capacity — one reason erasure coding is widely adopted in cloud object storage, like S3-style storage.

Reed-Solomon Code: the Most Widely Used Erasure Coding Algorithm

Reed-Solomon code is the most widely used algorithm for implementing erasure coding. Ceph’s default erasure plugin also uses this Reed-Solomon code. Object storage systems like MinIO apply erasure coding per object, which fits well with how an object gets treated as immutable data — written once, then read-only afterward.

The Trade-off: Slower Recovery (Rebuild) and Higher CPU Load

While erasure coding excels at capacity efficiency, recovering from a failure (rebuilding) requires far more computation (mathematical decoding) than a simple copy operation under replication, or a simple RAID rebuild, making it slower and more CPU-intensive. That’s exactly why replication still often gets chosen for latency-sensitive workloads.

What a Pro Sees Here (Top 1% Understanding)

RAID’s “Fixed Ratio” Constraint Was Never a Fundamental One

RAID 5 and RAID 6’s fixed parity ratio was designed within the physical constraint of a single disk array, and that fixed-ratio constraint itself turns out not to be fundamental at all under erasure coding, a more generalized framework. The habit of digging one layer deeper to ask whether a mechanism’s “seemingly obvious constraint” is genuinely fundamental, or merely an accident of the specific context that mechanism was born in is the perspective a top-1% engineer carries.

Common Misconceptions and Pitfalls

Troubleshooting Perspective

  1. You want to improve an object store’s capacity efficiency: Consider switching from replication to erasure coding.
  2. Recovery feels slow after adopting erasure coding: This is an expected trade-off — check whether CPU-intensive decoding is genuinely what’s happening.
  3. You’re unsure which to adopt for a latency-sensitive workload: Prioritize replication if recovery speed and CPU load matter most, or consider erasure coding if capacity efficiency matters most.

Summary

Takeaways to Apply Today

  1. When considering a storage redundancy scheme, clearly decide whether capacity efficiency or recovery speed matters more for your case.
  2. Dig one layer deeper on whether a mechanism’s constraint is genuinely fundamental, or just an accident of its specific context.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).