Skip to main content
RunBook Academy

CephXXVII · Replication vs Erasure CodingReplication vs Erasure Coding

A decision framework for pool type

Advanced⏱ ~17 minceph

What you'll learn

  • Apply the five-question framework to a workload
  • Identify which question is decisive in a given case
  • Handle mixed workloads that split across pools
  • Document a pool-type decision defensibly

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

Pool type is a one-way door at scale: changing it means migrating every object. A short, ordered framework produces a defensible answer in minutes and makes the reasoning reviewable afterwards.

The five questions

1. What is the write size distribution?

Small writes (under k × min_alloc_size, so under about 16 KiB for a typical 4+2) → replication. This question alone settles most cases.

2. Is the data modified in place after writing?

Frequent in-place modification → replication. Write-once or append-only → EC remains viable.

3. What is the latency requirement?

A p99 budget in single-digit milliseconds → replication. Tens of milliseconds or more → EC is fine.

4. How large is it, relatively?

If the workload is a small fraction of cluster capacity, the EC saving is not worth the complexity or the risk. Save EC for the workloads where the saving is material.

5. Does the cluster support the profile?

Enough failure domains for k+m with headroom, cluster network sized for k× recovery traffic, CPU headroom for decode. If not, the profile is not available regardless of workload fit.

The decision path

graph TD
    A[Workload] --> B{Writes under 16 KiB?}
    B -->|yes| R[Replication]
    B -->|no| C{Modified in place?}
    C -->|frequently| R
    C -->|rarely or never| D{p99 budget under 10ms?}
    D -->|yes| R
    D -->|no| E{Material share of capacity?}
    E -->|no| R
    E -->|yes| F{Cluster supports the profile?}
    F -->|no| R
    F -->|yes| G[Erasure coding]

The default at every unclear branch is replication. That asymmetry is deliberate: the cost of wrongly choosing replication is capacity, and the cost of wrongly choosing EC is a migration.

Worked examples

WorkloadDecisive questionAnswer
VM boot disks1 — small writesreplicated
S3 media bucketpasses all fiveEC
PostgreSQL data1 and 3replicated
Nightly backup targetpasses all fiveEC
CephFS metadataomap — EC unsupportedreplicated
500 GB config store4 — immaterial sizereplicated
Video archive on 8 hosts5 — insufficient domainsreplicated

Splitting mixed workloads

Most real platforms are not one workload. When the questions give different answers to different parts — live data versus backups, hot versus cold partitions — split them across pools rather than compromising on one type for everything.

Quiz

Knowledge check · 4 questions

  1. Q1. In the five-question framework, which question settles the majority of cases on its own?

  2. Q2. Defaulting to replication at an unclear branch is a deliberate asymmetry rather than simple caution, because the two possible wrong answers do not cost the same.

  3. Q3. Apply the framework to a mixed platform.

    A media company stores: 40 TB of active video editing project files accessed at low latency by editors, 900 TB of finished renders read occasionally for redistribution, and 2 PB of raw camera footage archived and almost never read. The cluster has 30 hosts and a 100 Gb cluster network.

  4. Q4. Why is it worth recording which question was decisive rather than just the final choice?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Run the framework at design time and record the decisive question in the pool documentation. Re-run it when the cluster changes shape or the workload’s access pattern shifts materially — pool type cannot be changed in place, but knowing a placement has become suboptimal lets you plan a migration deliberately rather than discover the mismatch during an incident.

Cross-course references

  • Kubernetes: an ordered decision procedure for StorageClass selection serves the same purpose
  • Linux: RAID level selection guides follow the same shape of ordered, cheapest-first questions