← Lessons

quiz vs the machine

Gold1400

System Design

Conflict Resolution Merge

Strategies for combining divergent edits into one agreed result.

5 min read · core · beat Gold to climb

What a merge must do

When two replicas diverge, a merge combines their changes into a single state. A good merge is deterministic, so any replica running it on the same inputs gets the same output, and it should preserve intent wherever the changes do not truly conflict.

Levels of conflict

  • Non conflicting edits touch different regions and simply both apply.
  • Concurrent same place edits need a rule, such as a CRDT id order or an OT transform.
  • Semantic conflicts, like one user deleting a paragraph another is editing, may need human review.

Merge strategies

  • Automatic merge resolves everything by structural rules and never asks the user.
  • Three way merge compares both versions against a common ancestor to tell inserts from deletions.

Real time editors lean on automatic structural merges so users almost never see a conflict dialog.

Key idea

A merge must deterministically combine divergent edits and preserve intent, escalating only true semantic conflicts.

Check yourself

Answer to earn rating on the learn ladder.

1. What makes a merge safe to run on any replica?

2. What does a three way merge use that a two way merge does not?