Skip to content

CRDTs and operational transformation

How replicas that accept writes independently still converge: merge rules that commute, counters and sets as CRDTs, and how OT and sequence CRDTs handle collaborative text.

30 min7 steps

By the end you can
  • Explain strong eventual consistency and the merge properties that guarantee it
  • Merge G-Counter and PN-Counter states and compute their values
  • Predict the outcome of concurrent add and remove under an OR-Set versus last-writer-wins
  • Transform concurrent text edits with OT and contrast OT with sequence CRDTs

Merge rules that cannot disagree

Last-writer-wins

  • Silently drops data

Keep siblings

  • Dynamo style
  • App code must merge

CRDT

  • Merge built into the type
  • Commutative, associative, idempotent
  • Strong eventual consistency
Same updates received means same state, in any order, any number of times.

Why must a state-based CRDT's merge be idempotent?

Answer this step to continue.