Problem
When replicas or offline clients accept writes independently, the same record can end up with divergent values. Without a rule, replicas disagree permanently or lose data silently.
Also known as: write-conflict-resolution, merge-strategies
Deterministically reconcile concurrent updates to the same data accepted by different replicas or clients.
When replicas or offline clients accept writes independently, the same record can end up with divergent values. Without a rule, replicas disagree permanently or lose data silently.
Conflict resolution is the policy that decides what a record's value becomes when two replicas accepted different updates concurrently. It is unavoidable in multi-leader, leaderless, and offline-capable systems, and the policy you choose determines whether users lose data.
First detect concurrency, then resolve. Version vectors tell you whether one write happened before another or whether they are concurrent siblings.
replica A: cart = {book} version [A:1]
replica B: cart = {pen} version [B:1] (concurrent)
merge(A, B) = union -> {book, pen} version [A:1, B:1]
Common strategies:
The resolver must give the same result on every replica regardless of order.
Low: logic in application or database
Medium: monitoring conflict rates
High: designing correct merge semantics
Clock skew makes last-write-wins pick the older edit
Non-commutative merge leaves replicas permanently divergent
Resurrected deletes because tombstones were purged too soon