How does the choice of R and W affect latency, and why does one slow replica matter more as the quorum grows?
Sketch your own answer first, then compare it with the one below.
A strong answer
The coordinator sends the request to every replica and waits for the first k replies, with k being R or W. The latency of the operation is the arrival time of the k-th fastest reply. Raising k moves you further into the tail of the reply times.
If one replica is slow, a small quorum simply ignores it, because k other replicas answer first. Once k exceeds the number of fast replicas, the operation must wait for a slow one, so latency jumps to that replica's. With k equal to N every operation is as slow as the slowest replica, and the chance that at least one replica is slow on a given request grows with N.
The trade can be tilted to the workload. With R=1 reads are fast, while W=N makes every write pay for the slowest replica. Sending a second request after a short delay, a hedged request, also trims the tail.
Sources
- Peter Bailis, Shivaram Venkataraman, Michael Franklin, Joseph Hellerstein, Ion Stoica (2012). Probabilistically Bounded Staleness for Practical Partial Quorums.
- Jeffrey Dean, Luiz André Barroso (2013). The Tail at Scale.