CRDTs let multiple replicas accept writes independently. Merges converge to the same result regardless of order. Powers Google Docs, offline apps, Redis Enterprise.
The property
Given any two states + any two operations, the merged result is the same regardless of merge order.
The property
Given any two states + any two operations, the merged result is the same regardless of merge order.
G-Counter
Grow-only counter. Each replica tracks its own count. Merge = sum. Commutative, associative, idempotent.
PN-Counter
Positive + Negative counters. Increments in one map, decrements in another. Merge each map by max. Difference = value.
OR-Set
Observed-Removed Set. Each add has a unique tag. Remove marks tag as tombstoned. Merge = union of adds minus tombstones.
Where CRDTs shine
Multi-master DBs, collaborative apps, offline-first mobile. Anywhere coordination is expensive or impossible.