System Design Cases
Quorum Reads & Writes
Quorum reads/writes concept page. Leaderless replica set N=3 (r1, r2, r3), client → coordinator → replicas pattern. Shows W+R>N strong consistency formula, ONE/QUORUM/ALL/LOCAL_QUORUM tunable consistency, sloppy quorum + hinted handoff during partition. Three scenarios: QUORUM strong (W=2,R=2,N=3), ONE/ONE fast-but-stale, sloppy quorum with hinted handoff replay after partition heal. Two ADRs: tunable W/R per workload, sloppy vs strict quorum trade-off.
Quorum reads and writes: overlap is necessary, not magical
For replication factor N, a write consistency level waits for W acknowledgements and a read waits for R responses. The classic visibility condition R + W > N guarantees an intersection between an acknowledged write quorum and a later read quorum. It helps only when the resolver can identify the correct newest version and the membership/failure model matches the arithmetic.
With N=3, W=2, R=2, every read quorum intersects the acknowledged write quorum. ONE + ONE does not. This overlap is not consensus, serializable transactions, or unconditional linearizability. Concurrent writes, ambiguous timeouts, cross-datacenter consistency levels, hinted handoff, and repair all need explicit semantics.
Prerequisites and model
Nis the replication factor for the relevant key and replica set, not the number of currently reachable nodes.- Writes may be sent to all replicas; W controls client acknowledgement threshold, not necessarily fanout.
- Read responses include version metadata and a deterministic/conflict-aware resolver.
- Retries preserve operation identity or are safe under the data type’s timestamp/merge rules.
Correctness claims and invariants
- QRW-C1.
R+W>Nforces read/write quorum intersection for the same replica set. - QRW-C2. Intersection exposes at least one acknowledged copy; it does not by itself prove linearizability or resolve concurrent values.
- QRW-C3. Cassandra consistency level controls required responses while mutations are normally sent toward all natural replicas.
- QRW-C4. A write timeout is ambiguous because some replicas may have persisted the mutation.
- QRW-C5.
LOCAL_QUORUMgives a local-DC threshold, not global freshest-after-remote-write semantics. - QRW-C6. Hints are best-effort temporary delivery aids; repair remains necessary for durable convergence.
What the scenarios prove
- RF=3, W=2, R=2 overlap (
rf3-quorum-overlap): The coordinator fans out and returns after two durable acknowledgements; a two-replica read intersects.
- ONE plus ONE can be stale (
one-one-stale-read): A read from the non-acknowledging replica need not see the write.
- Ambiguous write timeout (
write-timeout-ambiguous): One replica may commit before the acknowledgement path times out.
- LOCAL_QUORUM is not global (
local-quorum-remote-stale): A completed local-DC write may not yet be visible to a different DC local quorum.
- Hinted handoff and repair (
hinted-handoff): A hint helps a temporarily unavailable replica but remains bounded and best-effort.
- Concurrent quorum writes (
concurrent-writes): Overlapping quorums can still contain concurrent values requiring semantic resolution.
Failure, concurrency, and retry traps
R+W>Nis not a substitute for version correctness, fencing, or consensus.- Failed write does not mean no replica stored it.
- Client wall-clock last-write-wins can lose concurrent updates under skew.
- ANY may acknowledge a hint without a natural replica storing the mutation.
- LOCAL_QUORUM in another datacenter may lag a completed local write.
Boundaries and non-guarantees
- Quorum overlap is a replication visibility technique, not a multi-key transaction protocol.
- Availability falls as R or W rises; no threshold makes every partition available.
- Conflict resolution and application invariants remain separate.
- Hints do not replace anti-entropy repair.