Algorithm – Difference between OT and CRDT

Can someone briefly explain the main difference between Operation Transformation and CRDT?

As far as I know, both are algorithms that allow data to converge on different nodes in a distributed system without conflict.

In which use case would you use which algorithm?
As far as I know, OT is mainly used for text. CRDT is more general and can handle more advanced structures?

Is CRDT more powerful than OT?

I am asking this question because I am trying to see how to implement a collaborative editor for HTML documents, and I don’t know which direction to look at first. I saw the ShareJS project and they tried to support rich text collaboration on the contenteditables element on the browser. Nowhere in ShareJS I see any attempts to use CRDT.

We also know that Google Docs is using OT, which is very useful for rich documentation of real-time files.
Did Google choose to use OT because CRDT was not very well-known at the time? Or is it a good choice today?

I am also interested in hearing other use cases, just like using these algorithms on a database. Riak seems to use CRDT. Can OT be used to synchronize the nodes of the database, or can it replace Paxos / Zab / Raft?

Both methods are similar because they provide ultimate consistency. The difference is how they do it. One view is:

> OT does this by changing operations. Operations are sent over the wire, and once concurrent operations are received, they will be converted.
> CRDT is realized by changing state. The operation is carried out on the local CRDT. Its state is sent over the wire and merged with the state of the copy. No matter how many times or the order of merging-all copies will converge.

You are right. OT is mainly used for text and is earlier than CRDT, but research shows:

many OT algorithms in the literature do not satisfy convergence properties
unlike what was stated by their authors

In other words, CRDT merge is exchangeable, while OT conversion function is sometimes not.

From the Wikipedia article on CRDT:

OTs are generally complex and non-scalable

Yes Different types of CRDT (sets, counters,…) are suitable for different types of problems. Some are specifically designed for text editing. For example, Treedoc – A commutative replicated data type for cooperative editing.

Can someone briefly explain the main difference between operation transformation and CRDT?

As far as I know, both are algorithms that allow data to converge on different nodes in a distributed system without conflict.

In which use case would you use which algorithm?
As far as I know, OT is mainly used for text. CRDT is more general and can handle more advanced structures?

Is CRDT more powerful than OT?

I am asking this question because I am trying to see how to implement a collaborative editor for HTML documents, and I don’t know which direction to look at first. I saw the ShareJS project and they tried to support rich text collaboration on the contenteditables element on the browser. Nowhere in ShareJS I see any attempts to use CRDT.

We also know that Google Docs is using OT, which is very useful for rich documentation of real-time files.
Did Google choose to use OT because CRDT was not very well-known at the time? Or is it a good choice today?

I am also interested in hearing other use cases, just like using these algorithms on a database. Riak seems to use CRDT. Can OT be used to synchronize the nodes of the database, or can it replace Paxos / Zab / Raft?

Both methods are similar because they provide ultimate consistency. The difference is how they do it. One view is:

> OT does this by changing operations. Operations are sent over the wire, and once concurrent operations are received, they will be converted.
> CRDT is realized by changing state. The operation is carried out on the local CRDT. Its state is sent over the wire and merged with the state of the copy. No matter how many times or the order of merging-all copies will converge.

You are right. OT is mainly used for text and is earlier than CRDT, but research shows:

many OT algorithms in the literature do not satisfy convergence properties
unlike what was stated by their authors

In other words, CRDT merge is exchangeable, while OT conversion function is sometimes not.

From the Wikipedia article on CRDT:

OTs are generally complex and non-scalable

Yes Different types of CRDT (sets, counters,…) are suitable for different types of problems. Some are specifically designed for text editing. For example, Treedoc – A commutative replicated data type for cooperative editing.

Leave a Comment

Your email address will not be published.