← Lessons

quiz vs the machine

Gold1450

System Design

Leaderless Replication

Writing to many replicas with quorums and repairing staleness as you read.

5 min read · core · beat Gold to climb

No special node

In leaderless replication there is no leader. A client sends each write to several replicas directly, and reads from several too. This is the Dynamo style used by systems like Cassandra.

Quorums

With N replicas, a write goes to W of them and a read queries R of them. If W plus R is greater than N, the read and write sets overlap, so a read sees at least one copy of the latest write.

  • High W gives durable writes but slower writes.
  • High R gives fresh reads but slower reads.

Healing stale replicas

Because some replicas miss writes, the system repairs them.

  • Read repair when a read sees an old value on one replica it writes back the fresh one.
  • Anti entropy a background process compares replicas and copies missing data.

The tradeoff

Leaderless systems stay available even when many nodes are down, since there is no single write target. But the quorum overlap only guarantees freshness probabilistically, and concurrent writes still need conflict handling such as version vectors.

Key idea

Leaderless replication uses overlapping read and write quorums so reads see recent writes while background repair fixes the replicas that fall behind.

Check yourself

Answer to earn rating on the learn ladder.

1. What condition makes a quorum read see the latest write?

2. What does read repair do?