All Questions
Sharding hard

In a multi-master sharded system using 'Vector Clocks', what is the result if two clients update the same record on different servers at the exact same time (a 'Concurrent Write Conflict')?

  1. A The database preserves both versions as 'Siblings' and returns both to the next reader, forcing the application code to perform a 'Conflict Resolution' (e.g., merging the two results).
  2. B Both servers will instantly enter a 'Split Brain' state and shut down to prevent data corruption.
  3. C The server uses 'Last Write Wins' (LWW) based on its local wall-clock time, simply deleting the older version.
  4. D The database uses a randomized coin-flip to decide which of the two versions should be the permanent record.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions