← Lessons

quiz vs the machine

Platinum1850

Concurrency

Leaderless Replication Writes

Quorum reads and writes let any replica accept writes, trading coordination for availability.

6 min read · advanced · beat Platinum to climb

No single leader

In leaderless replication, used by systems like Dynamo style stores, there is no elected leader. A client sends a write to several replicas directly and considers it successful once enough of them acknowledge. Reads also query several replicas.

The quorum condition

Let N be the number of replicas, W the writes that must acknowledge, and R the reads that must respond. If W plus R is greater than N, every read overlaps at least one replica that saw the latest write, so reads can find an up to date value.

  • Choosing W and R high favours consistency but reduces availability.
  • Choosing them low favours availability and speed but risks stale reads.

Healing stale replicas

Because some replicas may miss a write, the system repairs them. Read repair updates a stale replica when a read detects it lags. Anti entropy background processes compare replicas and copy missing data. Conflicts from concurrent writes are resolved with vector clocks or last write wins.

Key idea

Leaderless replication lets any replica accept writes and uses the rule W plus R greater than N for overlap, trading tunable consistency against availability and repairing stale replicas in the background.

Check yourself

Answer to earn rating on the learn ladder.

1. What condition ensures a read overlaps the latest write?

2. How are stale replicas brought up to date?

3. What is the tradeoff of choosing low W and R?