Differences between OT and CRDT

前端 未结 1 888
借酒劲吻你
借酒劲吻你 2021-01-29 20:19

Can someone explain me simply the main differences between Operational Transform and CRDT?

As far as I understand, both are algorithms that permits data to converge with

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 21:03

    Both approaches are similar in that they provide eventual consistency. The difference is in how they do it. One way of looking at it is:

    • OT does it by changing operations. Operations are sent over the wire and concurrent operations are transformed once they are received.
    • CRDTs do it by changing state. Operations are made on the local CRDT. Its state is sent over the wire and is merged with the state of a copy. It doesn't matter how many times or in what order merges are made - all copies converge.

    You're right, OT is mostly used for text and does predate CRDTs but research shows that:

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

    In other words CRDT merging is commutative while OT transformation functions sometimes are not.

    From the Wikipedia article on CRDT:

    OTs are generally complex and non-scalable

    There are different kinds of CRDTs (sets, counters, ...) suited for different kinds of problems. There are some that are designed for text editing. For example, Treedoc - A commutative replicated data type for cooperative editing.

    0 讨论(0)
提交回复
热议问题