Scaling Writes hard
The Two-Phase Commit (2PC) protocol is often criticized for being 'Blocking'. What is the specific failure mode?
- A It blocks reads.
- B It requires too much bandwidth.
- C If the Coordinator crashes after sending 'Prepare' but before 'Commit', participants who voted 'Yes' are stuck holding locks indefinitely, unable to commit or abort.
- D It fails on slow networks.
Answer: C. If the Coordinator crashes after sending 'Prepare' but before 'Commit', participants who voted 'Yes' are stuck holding locks indefinitely, unable to commit or abort.
This is the single point of failure in 2PC. The participants surrender their autonomy to the Coordinator. If the Coordinator disappears, the system halts (safely, but unavailable).
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?