Encoding: from data blocks to a polynomial
Reed-Solomon coding treats a chunk of k data symbols not as raw bytes but as coefficients or evaluation points of a polynomial of degree less than k, working over a finite field, commonly the Galois field GF(2 to the 8th power) so that each symbol fits neatly in a byte. To produce m parity symbols, the encoder evaluates this polynomial at m additional, distinct points beyond the k used to represent the original data, or equivalently multiplies the data vector by a specially constructed generator matrix whose rows correspond to evaluation points. The key mathematical fact making this work is that a polynomial of degree less than k is completely and uniquely determined by any k of its evaluation points, a direct consequence of the fundamental theorem of algebra applied over a finite field. In storage systems this typically plays out as splitting a large file into stripes, taking k blocks per stripe as data, and computing m parity blocks per stripe, with all k plus m blocks distributed across distinct failure domains such as separate disks, servers, or racks so that a single hardware failure cannot take out more blocks than the code can tolerate.
The erasure model versus the error model
Reed-Solomon codes were originally designed to correct errors, meaning symbols that arrive corrupted at unknown positions, which is harder than correcting erasures, where the positions of missing symbols are known but their values are not. Distributed storage almost always operates in the erasure model: when a disk fails or a node goes offline, the system knows exactly which blocks are gone, it just needs to recover their contents. This distinction matters enormously for efficiency, because correcting t unknown-position errors requires 2t parity symbols under classical bounds, while correcting t known-position erasures requires only t parity symbols, exactly half the overhead. A system configured with k equals ten data blocks and m equals four parity blocks, often written as a 10-of-14 or RS(14,10) scheme, can therefore tolerate the loss of any four blocks in a stripe and still reconstruct everything, whereas achieving the same fault tolerance against undetected corruption at unknown locations would need twice as much parity.
Decoding: polynomial interpolation and Lagrange reconstruction
When up to m of the k plus m blocks in a stripe are missing, the surviving blocks are simply k or more known evaluation points of the original degree-less-than-k polynomial, and reconstruction becomes a classic interpolation problem: given enough points, reconstruct the unique polynomial that passes through them, then evaluate it back at the original data positions to recover the missing symbols. Lagrange interpolation provides the direct formula, expressing the polynomial as a weighted sum of basis polynomials each of which is one at exactly one known point and zero at the others, but practical implementations more often invert a submatrix of the generator matrix corresponding to the surviving evaluation points, since matrix inversion over the Galois field can be precomputed and optimized with lookup tables for the specific k and m chosen. All arithmetic happens in the finite field, where addition is bitwise XOR and multiplication uses field-specific tables, so the entire encode and decode process, despite sounding like heavyweight algebra, reduces in practice to fast table lookups and XOR operations that run efficiently even on commodity hardware, and increasingly on dedicated instructions in modern CPUs.
RAID6, HDFS, and the storage overhead tradeoff
RAID6 is the most familiar real-world instance of this idea, using exactly two parity blocks, often computed with a simplified Reed-Solomon-like scheme, to survive the simultaneous failure of any two disks in an array, an improvement over RAID5's single-parity tolerance that became necessary as disk sizes grew and rebuild times, during which a second failure is most dangerous, stretched longer. Distributed filesystems and object stores push the same idea further with larger k and m values tuned for their failure characteristics; HDFS's erasure coding mode, for instance, commonly uses schemes like 6-of-9 or 10-of-14, trading a higher chance of concurrent block unavailability during reconstruction for storage overhead as low as forty percent above the raw data size, compared to the two hundred percent overhead of three-way replication. The core tradeoff is a dial between storage efficiency and fault tolerance: increasing m raises the number of simultaneous failures a stripe can survive but adds proportionally more storage and computation cost, while increasing k relative to m lowers overhead but also raises the number of nodes that must be read to reconstruct even a single missing block, an important consideration for both durability math and real-world repair bandwidth.
Repair cost and why this matters at scale
Reed-Solomon's storage efficiency comes with a real operational cost during recovery: reconstructing even a single lost block in a naive scheme requires reading k surviving blocks across the network to run the interpolation, which at large k can mean substantial cross-node bandwidth and I/O just to fix one failure, a burden that grows heavier as clusters scale to thousands of nodes experiencing routine disk failures. This has driven an entire subfield of coding theory aimed at reducing repair bandwidth, including regenerating codes that trade a bit of extra storage for dramatically cheaper repairs by having surviving nodes send small linear combinations rather than entire blocks, and locally repairable codes that add extra, smaller parity groups so that most single-node failures can be fixed by reading only a handful of nearby blocks instead of the full k needed by classical Reed-Solomon. Understanding plain Reed-Solomon reconstruction is nonetheless the essential foundation for all of these refinements, since they all still rely at their core on the same principle that a polynomial, or a linear code more generally, can be recovered from enough independent pieces of evidence about its values.
Frequently asked questions
What does the notation RS(k+m, k) actually mean?
It describes a Reed-Solomon scheme with k data blocks and m parity blocks, for k+m total blocks per stripe. Any k of the k+m blocks, in any combination, are sufficient to reconstruct all the original data.
Why is erasure coding cheaper than replication for the same durability?
Three-way replication needs 200 percent storage overhead to survive two failures, while a Reed-Solomon scheme like RS(14,10) survives four failures with only 40 percent overhead. The polynomial math lets parity blocks encode redundancy far more densely than full copies do.
Why does Reed-Solomon use arithmetic over a Galois field instead of ordinary integers?
A finite field guarantees every nonzero element has a multiplicative inverse and that operations never overflow or lose precision, which is essential for the interpolation and matrix inversion steps to always succeed exactly. GF(2^8) is popular because each field element maps neatly onto one byte.
What is the practical difference between correcting errors and correcting erasures?
An erasure has a known location but unknown value, like a disk that is simply offline, while an error has an unknown location and unknown value, like silently corrupted data. Correcting erasures needs only half as much parity as correcting the same number of errors, which is why storage systems that know exactly which nodes failed can be far more storage-efficient.
Why can repairing a single lost block be expensive at scale?
Classical Reed-Solomon reconstruction needs to read k surviving blocks to rebuild even one missing block, which means significant network and disk I/O for large k. This repair bandwidth problem is why techniques like regenerating codes and locally repairable codes were developed as refinements.
Try it live
Everything above runs in your browser — open Reed-Solomon Erasure Coding for Distributed Storage and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Reed-Solomon Erasure Coding for Distributed Storage simulation