- Overview
- Design scope
Quorum consensus can guarantee consistency for both read and write operations. Some definitions first:
- N: Number of replicas.
- W: A write quorum of size W. For a write operation to be considered as successful, write operation must be acknowledged from W replicas.
- R: A read quorum of size R. For a read operation to be considered as successful, read operation must wait for responses from at least R replicas.
A coordinator acts as a proxy between the client and the nodes.
The configuration of W, R, and N, is a typical tradeoff between latency and consistency. If
How to configure N, W, and R to fit our use case? Here are some of the possible setups:
-
If
$R = 1$ , and$W = N$ , the system is optimized for a fast read. -
If
$W = 1$ and$R = N$ , the system is optimized for fast write. -
If
$W + R > N$ , strong consistency is guaranteed (Usually$N = 3$ ,$W = R = 2$ ) because there must be at least one overlapping node that has the latest data to ensure consistency. -
If
$W + R <= N$ , strong consistency is not guaranteed.