Skip to content
Navigation

Type at least two characters. Search covers page titles, headings, tags and database names.

↑ ↓ to navigateEnter to openEsc to close0 pages
Architectureintermediate

Quorum Reads and Writes

The R + W > N rule, what it does and does not guarantee, and how eventual consistency converges through repair.

3 min readIntermediateUpdated Edit this page

Quorum replication is the tunable middle ground between "acknowledge on one node" and "acknowledge everywhere". You choose how many replicas must respond to a write (W) and to a read (R), given a replication factor (N).

Quorum reads and writes with RF=3With replication factor three, a write acknowledged by two replicas and a read answered by two replicas always overlap in at least one replica, so the read observes the latest acknowledged write.writewritereadreadWriterW = 2ReaderR = 2Replica 1acknowledged writeReplica 2overlap replicaReplica 3stale until repair
Quorum reads and writes with RF=3

The overlap rule

If R + W > N, the set of replicas answering a read must overlap the set that acknowledged the write by at least one node. That node has the latest value, and the coordinator returns the newest version it receives.

With N = 3:

RWR + WGuaranteeTrade-off
112None; may read stale dataLowest latency both ways
224Overlap holdsBalanced, the usual choice
134Overlap holdsFast reads, writes fail if any replica is down
314Overlap holdsFast writes, reads fail if any replica is down

What the rule does not give you

Quorum overlap guarantees that a read sees the value of any completed write. It does not give you linearizability:

  • A write that failed after reaching one replica may still be returned by a later read, and may then be "un-returned" if that replica is not in the next read quorum.
  • Two concurrent writes are resolved by timestamp, so the outcome depends on clock quality rather than on a defined order.
  • There is no atomic read-modify-write. SELECT then UPDATE at quorum is still racy; that is what Cassandra's lightweight transactions (Paxos, IF conditions) exist for, at several times the latency.

If you need linearizability, you need consensus, not quorum.

Eventual Consistency

Replicas that missed a write converge through three mechanisms, and all three need to be working for "eventual" to be a short interval:

  • Hinted handoff. A coordinator stores a hint for a replica that was down and replays it when the replica returns. Hints expire — three hours by default in Cassandra — so a node down longer than that will not be caught up by hints alone.
  • Read repair. When a read detects divergence among the replicas it contacted, the newest value is written back to the stale ones. This only repairs data that is actually read.
  • Anti-entropy repair. A scheduled full comparison using Merkle trees, which is the only mechanism that repairs data nobody reads. See Repairs.

Choosing R and W

  • QUORUM read and write is the default recommendation: correctness by the overlap rule while tolerating one node down at N = 3.
  • LOCAL_QUORUM in a multi-datacenter deployment keeps the quorum inside the local datacenter, avoiding cross-region latency on every operation. Overlap then holds within the region, not globally.
  • ONE for both is appropriate for genuinely tolerant data — metrics, logs, caches — where a stale or lost read costs nothing.
  • ALL guarantees the freshest data and makes the operation fail if a single replica is unavailable. It converts a degraded cluster into an outage; use it rarely and deliberately.

Because the setting is per query in Cassandra and ScyllaDB, the right approach is per-operation: LOCAL_QUORUM for the reads that matter, ONE for the ones that do not.