advanced
1 min answer
Conflict-free replicated data types guarantee convergence without coordination. What do they cost, and when is the guarantee not enough?
Show the full answer Hide the answer
What they give
Convergence without a coordinator. Replicas that receive the same set of operations in any order reach the same state, which means local edits apply instantly, offline editing works naturally, and there is no central sequencer to become a bottleneck or a single point of failure.
What they cost
- Metadata. Convergence requires tracking causality and, for sequence types, identifiers for every element. Metadata can exceed the content, and for long-lived documents it grows continuously unless garbage collected — which is itself difficult without coordination.
- Restricted operations. Not every operation has a conflict-free formulation. Moves in a tree, and operations with global invariants, are hard or impossible.
- Implementation difficulty. Correctness is subtle, bugs manifest as rare divergence under specific interleavings, and those are extremely hard to reproduce.
- Convergence is not intent preservation. This is the key limitation.
Why convergence is not sufficient
CRDTs guarantee that replicas agree. They do not guarantee the agreed result is what either user meant.
Two users editing the same sentence converge to a deterministic interleaving of their characters, which may be nonsense. A merge that is formally correct and semantically wrong is still a defect — and in a design tool, a convergent result that relocates the object someone is currently dragging is experienced as the application fighting the user.
The practical position
- Use them where the data shape fits: collaborative text, sets, counters, presence.
- Use simpler rules where they fit better: last-write-wins on independent scalar fields is adequate and far cheaper.
- Use explicit user resolution where intent genuinely conflicts, since no algorithm can infer which of two incompatible intentions should survive.
- Choose by the operations the document supports, not by the elegance of the guarantee — the algorithm is the part that gets attention and the reconciliation experience is the part that generates support tickets.