Ask enough replicas on reads and writes that they must overlap, so you always see the latest write.
A quorum is the smallest number of copies that must agree before an operation counts. With N copies of the data, a write waits for W acknowledgements and a read asks R copies.
In a leaderless database, there is no boss. Each piece of data is stored on N nodes, called replicas. When a client writes, it sends the value to the replicas and waits until W of them say "done". The other replicas get the value a little later. When a client reads, it asks R replicas and takes the answer with the newest version.
Here is the key idea. Suppose N = 5, W = 3 and R = 3. A write reached 3 replicas. A read asks 3 replicas. Two groups of 3 taken from 5 must share at least one member (3 + 3 = 6, which is more than 5). That shared replica has the new value, and the read sees it. In short: if R + W > N, a read overlaps the latest successful write.
| W | R | R + W > N ? | Behaviour |
|---|---|---|---|
| 1 | 1 | No (2 is not above 3) | Fastest, but a read can miss the latest write |
| 2 | 2 | Yes (4 is above 3) | Majority for both. Balanced. One replica can be down. |
| 3 | 1 | Yes (4 is above 3) | Fast reads, slow writes. A write fails if any replica is down. |
| 1 | 3 | Yes (4 is above 3) | Fast writes, slow reads. A read fails if any replica is down. |
| Operation | Needs | Failures tolerated |
|---|---|---|
| Write | W replicas up | N - W |
| Read | R replicas up | N - R |
| Both at once | max(W, R) replicas up | N - max(W, R) |
A simplified model with no random numbers: the write is acknowledged by the fastest W replicas that are up, and the read asks the fastest or the slowest R that are up. Reply times are illustrative. A quorum alone does not give perfect (linearizable) behaviour: concurrent writes, sloppy quorums and clock-based tie-breaks can still cause surprises.
| Term | Meaning in easy words |
|---|---|
| N | The number of replicas that hold a copy of each item |
| W (write quorum) | How many replicas must acknowledge a write |
| R (read quorum) | How many replicas a read asks |
| Quorum | The minimum group that must agree, often a majority |
| Majority | More than half: floor(N / 2) + 1 |
| Overlap | A replica that is in both the write group and the read group |
| Read repair | Fixing an out-of-date replica when a read finds it |
| Hinted handoff | Holding a write for a down node and delivering it later |
| Sloppy quorum | Accepting a write on stand-in nodes when the usual ones are down |
| Anti-entropy | A background job that compares replicas and repairs them |
| Linearizability | The strongest rule: operations look as if they happen one at a time, in real-time order |
| Choice | We gain | We lose |
|---|---|---|
| Bigger W | Safer, more replicas have the write | Slower writes, fewer failures tolerated |
| Bigger R | Reads are more likely to be fresh | Slower reads, fewer failures tolerated |
| R + W > N | Reads overlap the last write | More waiting on every operation |
| R + W <= N | Fast and highly available | Reads can be stale |
| Larger N | More safety and more read capacity | More cost, more copying |
| Sloppy quorum | Writes succeed during failures | A weaker guarantee until hints are delivered |