Concepts

Conflict Resolution

Decide what happens when multiple devices or services change related state concurrently and no single update can safely overwrite the others.

intermediate3 min readUpdated 2026-05-18ModelingDataReliabilityOperationsTradeoffs
Concurrent WritesVersion CheckConflict CopyMerge PolicyLost Update

After this, you will understand

How Conflict Resolution helps you see where this idea appears in production systems, what problem forces it, and how to reason about the tradeoffs.

Naive mental model

Treat the idea as a definition to memorize.

Production pressure

Real systems force the idea to handle Concurrent Writes, Version Check, and Conflict Copy.

Better reasoning

Use the concept to decide what the system guarantees, what it risks, and what it costs to operate.

Think before readingWhere would Conflict Resolution appear in a real production system, and what failure or bottleneck would it help you reason about?
As you read, look for the pressure that creates the idea first. The mechanics matter more once the reason is clear.

Reading in progress

This page is saved in your local study history so you can continue later.

Concepts Covered

  • Concurrent writes
  • Lost updates
  • Base versions
  • Conflict copies
  • Server-side merge
  • User-visible conflicts
  • Last-writer-wins
  • Operational repair

Definition

Conflict resolution is the set of rules a distributed system uses when two or more changes cannot be safely applied as if they happened one after another.

In file sync, this happens when multiple devices edit the same file while disconnected or stale:

laptop edits file based on version 7
phone edits same file based on version 7
server already accepted laptop version 8
phone now uploads a different version 8 candidate

The system must decide whether to reject, merge, overwrite, or preserve both versions.

The Pain That Forces This Concept

The naive approach is last-writer-wins.

That sounds simple until a user loses work. If the phone uploads later and overwrites the laptop edit, the product may appear consistent while silently destroying data.

Other naive behavior is just as bad:

  • always reject stale writes and make offline editing painful
  • always create duplicates and make folders messy
  • try to merge binary files and corrupt them
  • hide conflicts until users discover missing work later

Conflict resolution exists because availability, offline use, and user trust pull against each other.

Mental Model

Every write should say what it was based on.

write file_id=f1
base_version=v7
new_manifest=m9
client_mutation_id=c_123

If the server still sees current version v7, the write can advance the file to v8.

If the server sees current version v8 already, the incoming write is concurrent or stale. Now the system needs policy.

How It Works

Common policies:

PolicyUse CaseRisk
Last-writer-winsLow-value metadata or reversible stateCan lose updates
Reject stale writeStronger correctnessBad offline user experience
Conflict copyPreserve both editsUser must clean up
Server mergeText or structured docsMerge logic can be wrong
Application-specific transformCollaborative editorsMore complex model

For many file sync products, conflict copy is a practical default:

report.docx
report (Haris's conflicted copy).docx

It may be annoying, but it preserves user work.

Tradeoffs

Conflict policy is product design as much as backend design.

GoalTension
Never lose user dataMore visible conflicts
Keep folders cleanMore risk of hidden overwrites
Support offline editsMore concurrent versions
Make sync automaticHarder merge semantics
Preserve auditabilityMore version metadata

A conflict resolver should be conservative when the system cannot prove a merge is safe.

Operational Reality

Operators should monitor:

  • conflict creation rate
  • stale write rejection rate
  • lost-update bug reports
  • conflict resolution latency
  • client mutation retries
  • server merge failures
  • version tree depth
  • users repeatedly conflicting on the same file

Failure modes:

  • A stale client overwrites a newer version.
  • Conflict copies are created for idempotent retries.
  • Merge logic treats binary files like text.
  • Rename conflicts are handled differently from content conflicts.
  • A client applies server conflict state out of order.
  • Conflict metadata is not visible enough for users to recover.

What to study next

These links keep the session moving: read prerequisites first, then open the systems, concepts, and patterns that deepen this page.

Used In Systems

System studies where this idea appears in context.

Related Concepts

Core ideas that connect to this topic.

Related Patterns

Reusable architecture moves built from these ideas.