Scrivio Interview library
ConceptFoundations7 min read · updated 12 November 2026

In a Dynamo-style store with replication factor N=3, explain read and write quorums R and W. Why does R + W > N give you reads that see the latest acknowledged write, and what can still go wrong?

With N = 3 replicas, a write is acknowledged once W replicas confirm it and a read waits for R replicas to answer. If R + W > N, any set of R replicas overlaps any set of W replicas in at least one node, so every read sees at least one copy of the latest acknowledged write, for example with W = 2 and R = 2, while W = 1 and R = 1 trades that for speed and eventual consistency. It can still go wrong with sloppy quorums and hinted handoff, concurrent writes resolved by last-write-wins under clock skew, and failed writes that were partly applied; quorums are not linearizability, so compare-and-set needs consensus, and read repair and anti-entropy repair make replicas converge.

Why this question is asked

Quorums are the knob that Dynamo-style databases, such as Cassandra, Riak and the systems inspired by Amazon's Dynamo paper, give us to trade consistency against latency and availability. The formula R + W > N is easy to remember, and that is the danger: people treat it as a promise of strong consistency, which it is not. Interviewers ask this question to see whether we understand why the overlap works and, more importantly, where it breaks. In this answer, we will recap replication and quorums, prove the overlap with a small example, compare common settings, go through the cases that still go wrong, see why quorums are not linearizable, and look at how replicas converge.

1A Quick Recap of Replication and Quorums

In a Dynamo-style store, every key is stored on N replicas; with N = 3, three nodes hold each value. There is no single primary: a client sends its request to a coordinator node, which forwards it to the replicas for that key. The client chooses how many replicas must answer. W is the number of replicas that must confirm a write before it is acknowledged, and R is the number of replicas whose answers a read waits for. Each value carries a version, typically a timestamp, and a read returns the newest one it collects.

In Cassandra these are consistency levels: ONE, QUORUM (a majority, 2 of 3), and ALL, plus LOCAL_ variants for multi-data-centre clusters.

2Why R + W > N Guarantees an Overlap

Take replicas A, B and C, and W = 2, R = 2. A write of version 2 succeeds on A and B; C missed it and still has version 1. Now any read that asks two replicas must include A or B, because there are only three replicas and the two it asks cannot both be C. So at least one answer has version 2, and the coordinator returns it. In general, if R + W > N, the R replicas and the W replicas cannot be disjoint, because together they would need more than N distinct nodes.

Java
N = 3, replicas A B C, write v2 with W = 2
A B C
after : v2 v2 v1 // write acknowledged after A and B confirm
read R=2: {A, B} -> v2, v2 -> v2
{A, C} -> v2, v1 -> v2 // newest version wins
{B, C} -> v2, v1 -> v2 // every pair includes A or B
With W = 1, R = 1 (R + W = 2, not > 3):
after : v2 v1 v1
read R=1: {C} -> v1 // stale read is possible
Common choices with N = 3
WRR + W > N?Behaviour
22YesBalanced: reads see acknowledged writes, tolerates one node down
31YesFast reads, but a write fails if any replica is down
13YesFast writes, reads fail if any replica is down
11NoFastest, eventual consistency, stale reads possible

Notice that the guarantee is about acknowledged writes, and it depends on the read choosing the newest version among the answers. It says nothing about writes that are still in progress or that failed.

3What Can Still Go Wrong

Sloppy quorums are the first trap. In Dynamo and Riak, when some of a key's replicas are unreachable, the write may be accepted by other nodes outside the key's normal replica set, which keep it as a hint and pass it on later; this is hinted handoff. The write counts as W confirmations, but they are not on the nodes a later read will ask, so the overlap is gone until the hints are delivered. Cassandra also stores hints for unreachable replicas, but it does not count them toward QUORUM, only toward the weakest level ANY; check your database's behaviour.

Concurrent writes are the second. If two clients write the same key at nearly the same time, replicas may receive them in different orders, and the store needs a rule to pick a winner. Last-write-wins by timestamp is common, and timestamps come from client or node clocks. If one clock is 200 milliseconds fast, a write that happened earlier can win over a later one, and the later write silently disappears.

Failed writes that partly applied are the third. With W = 2, suppose only replica A accepted the write and B and C timed out. The client gets an error and believes nothing changed. But A holds the new value, and a later read that includes A will return it, and read repair may even copy it to the others. So a 'failed' write can appear later, which is why writes should be idempotent and retried with the same value.

4Quorums Are Not Linearizability

Linearizability means the system acts like a single copy: once any read has returned a new value, no later read may return the old one. Quorums alone do not give that. While a write is reaching replicas, one quorum read may see the new value on A, and a read a moment later that asks B and C, which do not have it yet, returns the old value. Each read satisfied R, but together they went back in time. Read repair performed synchronously before answering reduces this, but does not make the system fully linearizable in every failure case.

Operations that depend on the current value, such as compare-and-set ('set the username only if it is not taken'), need agreement on order, which is consensus. Cassandra provides this with lightweight transactions, the IF NOT EXISTS and IF conditions, which run a Paxos round among the replicas and cost several round trips.

SQL
INSERT INTO usernames (name, user_id) VALUES ('ana', 42) IF NOT EXISTS;
-- [applied] = true first client
INSERT INTO usernames (name, user_id) VALUES ('ana', 77) IF NOT EXISTS;
-- [applied] = false, user_id = 42 second client: consensus decided the order

5How Replicas Converge

Since some replicas miss writes, the store needs ways to bring them back in line. Read repair happens during reads: when the coordinator sees that replicas returned different versions, it writes the newest version back to the stale ones, so frequently read keys heal quickly. Anti-entropy repair runs in the background over all data: replicas compare summaries of their data, typically Merkle trees, hash trees that let two nodes find which ranges differ without sending everything, and then exchange only the differing rows. In Cassandra this is nodetool repair, which must run regularly, within gc_grace_seconds, so that deletions reach every replica before their tombstones are removed.

Step throughA quorum read that repairs a stale replica
ClientCoordinatorReplica AReplica C
read key, R = 2
read
read
v2
v1
v2 (newest wins)
read repair: write v2

7 messages in order. Play them, or step through them one at a time.

6Follow-up questions

Why is W = 2, R = 2 the usual choice with N = 3?

It satisfies R + W > N, so reads see acknowledged writes, and it still tolerates one replica being down for both reads and writes. W = 3 would make every write fail when any replica is down, and R = 3 would do the same for reads.

Does a larger N make quorums safer?

It increases durability and lets the system tolerate more failures, for example N = 5 with W = 3 and R = 3 tolerates two nodes down. The same caveats about sloppy quorums, clock skew and partial writes still apply.

How do vector clocks help with concurrent writes?

Instead of picking a winner by timestamp, a vector clock records which writes each version has seen, so the store can tell whether one version replaced another or whether they were concurrent. Concurrent versions are kept as siblings and merged by the application, so no write is silently lost, at the cost of more complex reads.

7Conclusion

In this answer, we saw that with N = 3 replicas, W confirmations per write and R answers per read, R + W > N forces every read set to overlap every write set, so reads see the latest acknowledged write, as with W = 2 and R = 2, while W = 1 and R = 1 gives speed and eventual consistency. Sloppy quorums with hinted handoff, last-write-wins under clock skew and partly applied failed writes still cause surprises, quorums are not linearizable, so compare-and-set needs consensus such as Paxos-based lightweight transactions, and read repair and anti-entropy repair make replicas converge.

What to say in the interviewAbout 90 seconds aloud

Open with

With replication factor 3, each key lives on three replicas. A write is acknowledged when W of them confirm, and a read waits for R of them and returns the newest version among the answers.

Then, if they want more

If R plus W is greater than N, the set of replicas a read asks must overlap the set that acknowledged the write in at least one node, because two plus two is four and there are only three replicas, so the read always sees at least one copy of the latest acknowledged write.

W equals 2 and R equals 2 is the usual balance and tolerates one node down; W equals 1 and R equals 1 is fastest but only eventually consistent. Several things can still go wrong. With sloppy quorums, writes may land on substitute nodes as hints, so the read set no longer overlaps.

Concurrent writes resolved by last-write-wins depend on clocks, so with clock skew a later write can lose. And a write that failed for the client may still have been applied on one replica and show up later. Quorums are also not linearizable: two reads during an in-flight write can see new then old.

For compare-and-set I would use consensus, like Cassandra's Paxos-based lightweight transactions. Replicas converge through read repair and background anti-entropy repair with Merkle trees.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Redis documentation, MongoDB manual
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "In a Dynamo-style store with replication factor N=3, explain read and write quorums R...": https://scrivio-interview-library.netlify.app/databases/nosql-fundamentals/01656f51ed/