Skip to content
StackDecode
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.

ABC[1,0,0]

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

  1. 1Detect the conflict with versions
  2. 2Choose a strategy
  3. 3Merge or pick a winner
  4. 4Propagate the result

Where it is used

Multi-writer systems.

Watch out for

Last-write-wins can silently lose data.

Related