Quorum-Based Consensus
You'll learn how quorum-based systems achieve consistency without requiring every node to agree on every operation.
What Is a Quorum?
A quorum is the minimum number of nodes that must participate in a read or write operation for it to be considered successful. Instead of waiting for all replicas to agree (which sacrifices availability) or trusting a single node (which sacrifices consistency), quorum-based systems find a middle ground.
How It Works
The key insight: if your read quorum (R) and write quorum (W) overlap, you're guaranteed to read at least one up-to-date value.
The rule: R + W > N (where N is the total number of replicas)
For example, with N=5 replicas:
- Set W=3 (write must succeed on 3 nodes)
- Set R=3 (read must query 3 nodes)
- Since 3+3 > 5, at least one node in your read set has the latest write
Think of it like a classroom vote: if 3 out of 5 students must agree to record an answer, and you ask 3 students what the answer is, at least one of them will have participated in the most recent decision.
Real-World Systems
Cassandra and DynamoDB use tunable quorums. You can configure consistency levels:
QUORUM: majority of replicas (⌈N/2⌉ + 1)ONE: single replica (fast, but less consistent)ALL: every replica (consistent, but less available)
This flexibility lets you trade consistency for availability based on each operation's needs.
Key Takeaway: Quorum-based consensus ensures consistency by requiring read and write sets to overlap, allowing systems to maintain strong consistency guarantees without waiting for full consensus across all nodes.