Scaling Reads hard
In a distributed database with replication factor N=3, you configure Write Quorum W=2 and Read Quorum R=1. What consistency guarantee does this system provide?
- A Strong Consistency, because writes are confirmed by a majority.
- B Eventual Consistency, because R + W <= N (1 + 2 = 3), creating a possibility of reading stale data from the node that missed the write.
- C Linearizability.
- D Read-Your-Writes Consistency.
Answer: B. Eventual Consistency, because R + W <= N (1 + 2 = 3), creating a possibility of reading stale data from the node that missed the write.
To guarantee Strong Consistency in a quorum system, the condition `R + W > N` must be met. Here, `1 + 2 = 3`, which is not greater than 3. The reader might hit the one node that hasn't received the write yet.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a caching system, what is a 'Cache Miss'?
- Why is `SELECT * FROM Users` generally discouraged in high-performance applications compared to `SELECT name, email FROM Users`?
- You have users all over the world downloading large images from your server in New York. Users in Australia complain it is slow. What solves this?
- What is the main downside of reading from a Read Replica instead of the Primary database?
- You have maximized the RAM on your single database server, but it's still too slow. You decide to add 10 more servers to share the load. What is this called?
- You have 5 Read Replicas. How does the application know which one to ask for data?