Read Write Quorums

Hello World
1 min readJan 19, 2021

Short answer:

Read/Write Quorums in short is a way to guarantee read-after-write consistency in a distributed service with multiple replicas.

Longer answer:

In a system with n replicas, if a write is acked by w replicas, and we subsequently read from r replicas, and r+w > n, then we’ll see the most updated value that’s previously written.

Why should r+w > n? because if r+w>n, then it guarantees that there’ll be overlap between the replicas we write to and the replicas we read from. Then, if we look at the all the values we read from the r replicas and take the value with most recent timestamp, then it will certainly be the most updated value written to the system.

Typical value of r and w are determined by:

r = w = (n+1)/2, assuming n is odd(e.g 3,5,7,..)

So, with Read Write Quorums we have read-after-write consistency. Also, when reading from the system, n-r unavailable nodes are tolerable. When writing to the system, n-w unavailable nodes are tolerable.

Since the choice of r/w is about half of n, replicated distributed system can tolerate ~half of the nodes going down without having issues!

Reference:

https://www.youtube.com/watch?v=uNxl3BFcKSA

--

--

Hello World

Software engineer, interested in learning how things work. What things? algorithm, system design, tech, business, politics, human.