A different approach
Where operational transformation rewrites operations, a conflict free replicated data type for text gives every character its own stable identity that never changes. Edits merge by identity, so no central server is required to keep replicas in sync.
Identities instead of positions
- Each inserted character gets a unique identifier that encodes its position relative to neighbors.
- Identifiers are dense, meaning a new id can always be created between any two existing ones.
- A delete marks the character as a tombstone rather than shifting offsets.
Why merges just work
Because ids carry their own order, two replicas that insert concurrently produce ids that sort into a deterministic sequence. Merging is simply taking the union of characters and sorting by id. Order of arrival no longer matters, so replicas converge offline and reconcile when reconnected.
Costs to know
- Tombstones accumulate and may need periodic garbage collection.
- Identifiers add metadata overhead per character.
Key idea
A text CRDT gives every character a stable dense identifier so edits merge by union and sort deterministically, letting replicas converge without a central server even after editing offline.