The promise
A CRDT is a data type designed so that replicas can be updated independently and concurrently, then merged without conflicts. No coordination or locking is needed, which makes them ideal for multi leader and offline systems.
Why merging always works
CRDT merge is built to be commutative, associative, and idempotent. That means applying updates in any order, more than once, still reaches the same final state. Every replica that has seen the same set of operations converges to one value.
Common examples
- Grow only counter each node counts its own increments and merge sums them.
- Grow only set merge takes the union of elements.
- Last write wins register keep the value with the highest timestamp and node id.
Removal is harder, so sets often track tombstones to remember deletions.
Where they shine
CRDTs power collaborative editors, shopping carts, and presence systems where users edit shared state while disconnected. The cost is metadata overhead and that some operations like arbitrary delete are tricky to model.
Key idea
CRDTs use commutative associative idempotent merges so concurrent replicas converge to the same state with no coordination required.