Durability: replication and erasure coding

How storage systems survive disk failures without storing three full copies of everything.

On the roadmap:Advanced · step 3: Storage engines

Lesson 14 of 23 · 7 min read · quiz · exercise

Why durability is hard

Disks fail every day in a large fleet. Durability is the probability data is not lost over time, and cloud object storage advertises numbers like eleven nines. How?

The inside of a hard disk drive: spinning platters and a moving read-write head, which eventually wear outImage: Mk2010 · CC BY 4.0 · Source · Wikimedia Commons: Hard disk drive platter, Samsung MP0402H

Technique 1: replication

Keep N full copies on different machines, racks and zones. Simple and fast:

  • Any copy can serve a read.
  • Recovery is just copying a replica.
  • Cost: 3 copies mean 3x storage.

Technique 2: erasure coding

Split an object into k data pieces, compute m parity pieces (using maths such as Reed-Solomon), and store all k + m pieces on different machines. Any k of the k + m pieces can rebuild the original.

Figure SDA-CORE-14-1 · Technique 2: erasure coding · © forcsguy.com

With (6, 3) you store 9 pieces for 6 pieces of data: 1.5x overhead, and you can lose any 3 disks. That beats 3x replication on both counts.

Figure SDA-CORE-14-2 · Surviving two failures and rebuilding · © forcsguy.com

The trade-offs

ReplicationErasure coding
Storage overheadhigh (3x)low (about 1.2x to 1.5x)
Readfrom one copy, fastread several pieces, fast if all data pieces present
Repaircopy one replicaread many pieces and recompute
Small updateseasycostly (re-encode)
Best forhot, small, frequently changed datacold, large, rarely changed objects

Making it real

  • Placement: put pieces in different failure domains (disk, server, rack, zone) so one event cannot take many.
  • Detection and repair: monitor continuously, and rebuild lost pieces before more fail. The faster the repair, the higher the durability.
  • Checksums: verify data on read and in background scrubbing to catch silent corruption.
  • Tiering: hot data replicated; older data converted to erasure coding.
  • Versioning and backups protect against human error, which replication does not (a delete replicates too).

More on this site

Check your understanding

Question 1 of 3

0 correct so far

What is the main advantage of erasure coding over 3x replication?

© 2026 forcsguy.com. Original lesson text and diagrams. Books and sites linked above belong to their authors.