Academy · Consistency & Consensus

Quorums (R + W > N)

With N replicas, how many must respond to a read/write so you never read stale data?

Open the interactive version → diagrams, practice & more

The problem

With N replicas, how many must respond to a read/write so you never read stale data?

The idea

Require overlapping majorities: if read quorum R + write quorum W > N, every read sees the latest write.

How it works

Write to W replicas, read from R, with R+W>N guaranteeing overlap. W>N/2 also stops two conflicting writes from both succeeding. Tune R/W for read- vs write-heavy needs.

The tradeoff

Bigger quorums = stronger consistency but higher latency and lower availability under failures.

In the wild

Dynamo-style stores expose N/R/W (classic N=3, R=2, W=2).

Interview deep dive

Flow

  1. Replicate each value to N nodes.
  2. Accept a write only after W replicas acknowledge it.
  3. Serve a read after R replicas respond.
  4. Because R+W>N, the read overlaps at least one latest writer.

Watch for

Interviewer trap

Use numbers in the answer: for N=3, compare R=1/W=3 with R=2/W=2.

Related Academy

Part of Academy on SystemLore — system design interview prep with 148 deep topics, interactive diagrams, and a practice game. Practice this one →