Scaling Writes hard
In a Dynamo-style system allowing concurrent writes (Multi-Master), how do Vector Clocks help resolve conflicts?
- A They detect causal relationships (ancestor vs. descendant). If Vector A < Vector B, A can be safely overwritten. If they are concurrent (neither dominates), both versions are kept for client reconciliation.
- B They use NTP timestamps to pick the latest write.
- C They lock the rows.
- D They merge the data automatically.
Answer: A. They detect causal relationships (ancestor vs. descendant). If Vector A < Vector B, A can be safely overwritten. If they are concurrent (neither dominates), both versions are kept for client reconciliation.
Vector clocks track the 'history' of updates across nodes. They can mathematically prove if one event happened *after* another or if they happened *simultaneously* (conflict), unlike wall-clock timestamps which are ambiguous.
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?