Quorum Reads and Writes
The R + W > N rule, what it does and does not guarantee, and how eventual consistency converges through repair.
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).
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:
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.
SELECTthenUPDATEat quorum is still racy; that is what Cassandra's lightweight transactions (Paxos,IFconditions) 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
QUORUMread and write is the default recommendation: correctness by the overlap rule while tolerating one node down at N = 3.LOCAL_QUORUMin 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.ONEfor both is appropriate for genuinely tolerant data — metrics, logs, caches — where a stale or lost read costs nothing.ALLguarantees 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.