What is a Quorum?
You'll learn: How quorums define the minimum number of nodes that must agree for read or write operations to succeed in distributed systems.
The Core Idea
A quorum is the minimum number of replicas that must participate in a read or write operation for it to be considered successful. Think of it like a voting system: instead of waiting for all nodes to respond (which could take forever if one is slow or down), you only need a majority vote to proceed.
In a system with N replicas, you typically define:
- W: write quorum (nodes that must acknowledge a write)
- R: read quorum (nodes that must respond to a read)
The magic happens when W + R > N. This overlap ensures that any read will see at least one node with the latest write, giving you consistency guarantees even in a distributed environment.
A Simple Example
Imagine you have 5 replica nodes (N=5). You might configure:
- W = 3 (3 nodes must confirm writes)
- R = 3 (must read from 3 nodes)
Since 3 + 3 > 5, there's guaranteed overlap. At least one node in your read quorum participated in the most recent write quorum, so you'll see fresh data.
Why Quorums Matter
Quorums let you tune your system's behavior. Want stronger consistency? Increase W and R. Need faster writes? Lower W (but you sacrifice consistency). A common configuration for eventual consistency is W=1, R=1 (fast but loose), while strong consistency might use W=N or R=N (slow but safe).
Key Takeaway: A quorum is the minimum node agreement threshold that balances availability, consistency, and performance by ensuring overlapping read and write sets in replicated systems.