advanced 2 min answer

A collaborative product must let several devices edit the same records, including offline. When are CRDTs the right answer, and when is server authority simpler?

linearcrdtsyncconflictscomplexity
Show the full answer Hide the answer

When CRDTs earn their cost

When concurrent editing of the same field is common and a merge is genuinely meaningful — collaborative text, a shared list, a set of labels. The convergence property is real: replicas that have seen the same operations agree without coordination.

And when offline periods are long enough that server-mediated conflict resolution would reject too much work.

When server authority is simpler and sufficient

When conflicts are rare and the resolution rule is per field rather than per character. For most business records — a status, an assignee, a due date — last-writer-wins with a version check is adequate, understood by everyone, and requires no new data structure.

Most products described as needing CRDTs need a conflict policy per field and a good sync engine, which is substantially less machinery.

What CRDTs cost

  • A larger, more complex data representation, with metadata that grows with the operation history and requires compaction that is itself non-trivial.
  • A model that most engineers do not have, so every future change carries a comprehension cost.
  • Difficulty enforcing invariants. A CRDT converges; it does not guarantee that the converged state is valid. A business rule such as "an item may have at most one assignee" is not naturally expressible, and enforcing it reintroduces coordination.
  • Debugging that is genuinely hard, since the state is a function of an operation history that differs per replica.

The design question that decides it

Does a merge of two concurrent edits produce something meaningful, or does one of them simply have to win?

For text, a merge is meaningful. For a status field, it is not — and pretending otherwise produces a converged state that is valid according to the data structure and wrong according to the business.

The property both approaches need

A rejected change must be surfaced. Whichever resolution is used, silently discarding a user's work is what users find most alarming — and the recovery path must be designed rather than being an absence.