Scaling Writes medium
You configure your Primary database to use 'Synchronous Replication' to a Replica. What is the impact on Write performance?
- A Writes become faster because two servers handle the load.
- B Writes fail immediately.
- C Write latency increases. The Primary must wait for the Replica to confirm it received the data (Network Round Trip) before returning 'Success' to the client.
- D Writes become asynchronous.
Answer: C. Write latency increases. The Primary must wait for the Replica to confirm it received the data (Network Round Trip) before returning 'Success' to the client.
Synchronous replication guarantees Zero Data Loss (RPO=0) if the Primary crashes, but you pay for it with latency. The write speed is limited by the slowest network link between the Primary and the Replica.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What does the 'Atomicity' property in a database transaction guarantee regarding writes?
- Your database is struggling with write traffic. You decide to 'Scale Up' (Vertical Scaling) by buying a bigger server. What is the eventual hard limit of this strategy?
- A developer sets up a 'Fire-and-Forget' write pattern (sending data without waiting for a database confirmation) to speed up the app. What is the major risk?
- Why is inserting 1,000 rows in a single 'Batch' query faster than executing 1,000 separate `INSERT` queries?
- In the Raft consensus algorithm, what mechanism prevents a 'Split Vote' (where no leader gets a majority) from stalling the cluster indefinitely?
- Your 'Logs' table has 10 billion rows and writes are getting slow. You barely access logs older than 1 year. What is the simplest strategy to improve performance?