System Design
18. Advanced Distributed ArchitectureAnimated
Conflict Resolution
Handling concurrent updates to the same data.
The idea
Strategies include last-write-wins, merging, CRDTs and asking the user.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
Process A a local event: increment its own counter. Timestamp [1,0,0].
- event:
- 1
1/9
Vector clocks can tell whether two events are ordered or concurrent.
Step by step
- 1Detect the conflict with versions
- 2Choose a strategy
- 3Merge or pick a winner
- 4Propagate the result
Where it is used
Multi-writer systems.
Watch out for
Last-write-wins can silently lose data.