In a leaderless replicated store, what do N, R and W mean?
Sketch your own answer first, then compare it with the one below.
A strong answer
N is the number of replicas that store each item. W is how many replicas must acknowledge a write before the client is told it succeeded. R is how many replicas a read waits for before it returns, taking the newest version among the answers.
The coordinator sends each request to all N replicas and waits for the first W or R replies. So W and R are the two dials. Higher values give stronger guarantees and slower, less available operations. Lower values give faster, more available operations that can return old data.
Take N=3 with R=2 and W=2. With one replica down, both reads and writes still find two live replicas.
Sources
- Giuseppe DeCandia and others (2007). Dynamo: Amazon's Highly Available Key-value Store.
- David Gifford (1979). Weighted Voting for Replicated Data.