# Comparison of CRDT and OT

Both CRDT and [Operation Transformation(OT)][ot] can be used in online
collaborative applications, with the following differences

| OT                                                                                                                                                                                                   | CRDT                                                                                  |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
| OT relies on a centralized server for collaboration; [it is extremely difficult to make it work in a distributed environment](https://digitalfreepen.com/2018/01/04/operational-transform-hard.html) | CRDT algorithm can be used to synchronize data through a P2P approach synchronization |
| The earliest paper on OT was presented in 1989                                                                                                                                                       | The earliest paper on CRDT appeared in 2006                                           |
| The OT algorithm is designed with higher complexity to ensure consistency                                                                                                                            | The CRDT algorithm is designed to be simpler to ensure consistency                    |
| It is easier to design OT to preserve user intent                                                                                                                                                    | It is more difficult to design a CRDT algorithm that preserves user intent            |
| OT does not affect document size                                                                                                                                                                     | CRDT documents are larger than the original document data                             |

[a highly-available move operation for replicated trees]:
  https://martin.kleppmann.com/papers/move-op.pdf
[moving elements in list crdts]:
  https://martin.kleppmann.com/papers/list-move-papoc20.pdf
[interleaving anomalies in collaborative text editors]:
  https://martin.kleppmann.com/papers/interleaving-papoc19.pdf
[conflict-free replicated data types]: https://readpaper.com/paper/1516319412
[5000x faster crdts: an adventure in optimization]:
  https://josephg.com/blog/crdts-go-brrr/
[json crdt]: https://arxiv.org/abs/1608.03960
[yata]:
  https://www.researchgate.net/publication/310212186_Near_Real-Time_Peer-to-Peer_Shared_Editing_on_Extensible_Data_Types
[yjs]: https://github.com/yjs/yjs
[loro]: https://loro.dev
[automerge]: https://github.com/automerge/automerge
[half grid]: https://zh.wikipedia.org/wiki/%E5%8D%8A%E6%A0%BC
[ot]: https://en.wikipedia.org/wiki/Operational_transformation
[crdts and the quest for distributed consistency]:
  https://www.infoq.com/presentations/crdt-distributed-consistency/