Problem
Multi-writer and offline-capable systems accept concurrent updates on different replicas. Locking or consensus on every edit kills availability and latency. Ad hoc merging yields divergence or lost updates.
Also known as: conflict-free-replicated-data-types, convergent-replicated-data-types
Let replicas update data independently and merge automatically to the same state without coordination.
Multi-writer and offline-capable systems accept concurrent updates on different replicas. Locking or consensus on every edit kills availability and latency. Ad hoc merging yields divergence or lost updates.
Conflict-free replicated data types are structures whose merge function guarantees convergence. Each replica applies updates locally and exchanges state or operations later, in any order. Redis Enterprise, Riak and collaborative editors such as Automerge and Yjs rely on them.
A G-Counter keeps one slot per replica. Increments touch only your slot; merge takes the maximum per slot; value is the sum.
A: {A:3, B:0} B: {A:2, B:4}
merge = max per slot -> {A:3, B:4}
value = 7
merge(x, x) = x ; merge(x, y) = merge(y, x)
An OR-Set tags each added element with a unique id; a remove deletes only the tags it observed, so a concurrent add wins. Delta CRDTs send only the changed fragment, reducing bandwidth. Convergence holds because the merge is a least upper bound on a lattice.
Higher storage for metadata
Medium: garbage collection and compaction
High: choosing and composing types
Tombstone growth bloating storage
Merged result surprises users because intent was not preserved
Causal delivery violated in operation-based designs