Dealing With Contention medium
In eventual consistency, 'Last Write Wins' (LWW) resolves conflicts by:
- A Merging the data strings.
- B Using the timestamp. The update with the highest timestamp overwrites others. This is simple but can lead to silent data loss if clocks are skewed.
- C Asking the user.
- D Using AI.
Answer: B. Using the timestamp. The update with the highest timestamp overwrites others. This is simple but can lead to silent data loss if clocks are skewed.
Simple, standard (Cassandra default), but dangerous. If 3:00pm write arrives at server at 3:01pm, and 2:59pm write arrives at 2:59pm, 2:59 is lost.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- Why is 'Exponential Backoff' preferred over constant intervals for retries?
- What is the primary purpose of a Mutex (Mutual Exclusion) lock?
- Why does adding more threads sometimes *decrease* performance?
- In a Saga, if a Compensating Transaction (Undo) fails repeatedly due to contention, what is the last resort?
- In a database, what happens if Transaction A locks a row and Transaction B tries to modify the same row?
- A database restart causes thousands of application servers to instantly try to reconnect. This crashes the DB again. This is called: