Skip to content
Omnikalc

Erasure coding calculator: compare a k+m code with replication and RAID

Enter the data and parity shards and the drive size to get the usable capacity, the storage overhead, the number of drive failures tolerated and the comparison with 3-way replication.

Updated on
Your inputs

Value out of range

Value out of range

TB

Value out of range

Results

Usable capacity

96.0 TB

Raw capacity
132.0 TB
Storage efficiency
72.7 %
Storage overhead
1.375 ×
Drive failures tolerated
3
Survives several drive failures
Usable capacity with 3-way replication on the same drives
44.0 TB
Shards read to rebuild one lost shard
8

Copies are a costly way to protect data. Erasure coding protects it with far less extra space. The erasure coding calculator gives the usable capacity, the overhead, the number of failures tolerated and the rebuild reads of a k+m code, and compares it with 3-way replication.

How the calculation works

  • Enter the number of data shards k and the number of parity shards m of the code, written k+m (for instance 8+3).
  • Enter the capacity of each drive. The calculator assumes that every shard of a stripe is on a different drive.
  • The usable capacity is k × drive size, the overhead is (k + m) / k, and the code tolerates the loss of m drives.
  • The result is compared with 3-way replication on the same drives, and gives the number of shards read to rebuild a lost one.

Example

An 8+3 erasure code on 11 drives of 12 TB has a raw capacity of 132 TB and a usable capacity of 96 TB. The efficiency is 72.7 %, the overhead 1.375×, and 3 drives can fail without data loss. The same drives with 3-way replication would give only 44 TB, but a rebuild needs to read 8 shards instead of one.

Why it matters

The calculator helps administrators and architects who plan a storage cluster, an object store or a NAS to see how much space they get for a level of safety, and to explain the trade-off between cost, tolerance and rebuild effort.

Good to know

The calculator assumes identical drives, one shard per drive and an even spread of the data. Real systems add a metadata overhead, a reserve for the rebuilds, a file system and a fill limit, so the usable capacity is smaller. The probability of data loss depends on the failure rate, the rebuild time and the failure domains, and it is not computed here. A backup is not replaced by redundancy.

The RAID capacity calculator covers the classic RAID levels, the cloud storage cost calculator prices storage in the cloud, the home server cost calculator budgets a server, and the photo storage calculator sizes the space for pictures.

Frequently asked questions

What is erasure coding?

Erasure coding splits an object into k data shards and computes m parity shards with a code such as Reed-Solomon, so that any k of the k+m shards are enough to rebuild the object. It is the generalization of RAID parity: RAID 5 is a code with m = 1, RAID 6 with m = 2. Object stores and distributed file systems such as Ceph, MinIO, HDFS and Azure or Google storage use it to protect data at a lower cost than copies.

How does it compare with replication?

Three-way replication tolerates 2 failures and has an overhead of 3×, a usable capacity of only 33 %. An 8+3 code tolerates 3 failures with an overhead of 1.375×, a usable capacity of 72.7 %. The price is more work: a write must compute and send parity, and a read of a degraded object, or the rebuild of a drive, must read k shards from other drives and use more network and CPU.

How do I choose k and m?

A larger m gives more safety. A larger k gives more efficiency but longer rebuilds, a larger group of drives for each object and more risk of a slow drive. Common choices are 4+2 for small clusters, 8+3 and 10+4 for big ones, and 6+3 for data in three sites. The number of failure domains (drives, servers, racks) must be at least k + m, so that the shards are in distinct places.

What does the rebuild cost?

To rebuild one lost shard, a Reed-Solomon code reads k shards, so the traffic of a rebuild is k times the size of the lost data, while replication copies it once. Locally repairable codes reduce this at the cost of more parity. A longer rebuild extends the time when the system is more exposed, so large drives call for a higher m or a faster repair.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.