- rtshkmr's digital garden/
- References/
- Architecture Design Basics/
- Pattern Taxonomy/
- Reliability, Consistency & Synchronisation/
- Quorum Reads & Writes/
Quorum Reads & Writes
··
157 words·
1 min
Table of Contents
🔴 P0 — the mathematical foundation for consistency in replicated systems
Problem #
With N replicas, how many must acknowledge a write (W) and how many must respond to a read (R) to guarantee the reader sees the latest write?
Mechanism #
The quorum condition: W + R > N
N = 3 replicas
Config 1: W=2, R=2 → overlap guaranteed → strong reads
Config 2: W=3, R=1 → writes slow (all must ack), reads fast (one suffices)
Config 3: W=1, R=3 → writes fast, reads slow (must check all)
Config 4: W=1, R=1 → NO overlap → eventual consistency onlyKey Trade-offs #
| Config | Write latency | Read latency | Consistency | Write availability |
|---|---|---|---|---|
| W=2, R=2 | Medium | Medium | Strong | Tolerates 1 failure |
| W=N, R=1 | Slow (all) | Fast | Strong | No write tolerance |
| W=1, R=N | Fast | Slow (all) | Strong | Highest write avail |
| W=1, R=1 | Fastest | Fastest | Eventual only | Highest |
Instinct #
W=2, R=2 with N=3 is the standard balanced configuration. Adjust based on read/write ratio: read-heavy → lower R, higher W. Write-heavy → lower W, higher R. But remember: quorums don’t guarantee linearisability by themselves — you also need mechanisms to handle concurrent writes (version vectors, last-write-wins).
References #
DDIA 2e Reference #
- Chapter 5: Quorums for reading and writing
- Chapter 9: Limitations of quorum consistency