Practice this topic in a realistic system design interview
The simplest way to protect data is replication: store multiple full copies, and if one copy is lost, read another. It works, and it is easy to understand, but it is expensive.
With 3x replication, every 1 TB of user data uses 3 TB of raw storage. That extra 2 TB is a 200% extra storage. This can be fine for hot data, but it gets painful for large archives, backups, data lakes, object stores, and cold file systems.
Erasure coding protects data with much less extra storage. Instead of storing full copies, it splits data into pieces, creates extra recovery pieces called parity fragments, and spreads all the pieces across different disks, nodes, racks, or zones.
If some pieces are lost, the system can rebuild the original data from the pieces that remain.
The trade-off is real: erasure coding saves storage, but writes, reads during failures, and repairs become more expensive. This chapter explains how it works, where the math intuition comes from, and when the trade-off is worth it.