OT和CRDT之间的区别 [英] Differences between OT and CRDT

查看:855
本文介绍了OT和CRDT之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以简单地解释一下我的操作转换和CRDT之间的主要区别吗?

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 without conflict on different nodes of a distributed system.

在哪种情况下,您将使用哪种算法?
据我了解,OT主要用于文本,而CRDT更通用,可以处理更高级的结构,对吗?

In which usecase would you use which algorithm? As far as I understand, OT is mostly used for text and CRDT is more general and can handle more advanced structures right?

CRDT是否比OT更强大?

Is CRDT more powerful than OT?

我问这个问题是因为我试图了解如何为HTML文档实现协作式编辑器,并且不确定首先看哪个方向。我看到了ShareJS项目,并尝试了在 contenteditables 元素上支持浏览器中的富文本协作。在ShareJS的任何地方,我都看不到尝试使用CRDT的任何尝试。

I ask this question because I am trying to see how to implement a collaborative editor for HTML documents, and not sure in which direction to look first. I saw the ShareJS project, and their attempts to support rich text collaboration on the browser on contenteditables elements. Nowhere in ShareJS I see any attempt to use CRDT for that.

我们还知道Google Docs正在使用OT,并且对于丰富文档的实时版本来说效果很好。
因为当时还不太了解CRDT,Google是否选择使用OT?还是今天也会是一个不错的选择?

We also know that Google Docs is using OT and it's working pretty well for real-time edition of rich documents. Is Google's choice of using OT because CRDT was not very known at that time? Or would it be a good choice today too?

我也很想知道其他用例,例如在数据库上使用这些算法。 Riak似乎使用了CRDT。

I'm also interested to hear about other use cases too, like using these algorithms on databases. Riak seems to use CRDT. Can OT be used to sync nodes of a database too and be an alternative to Paxos/Zab/Raft?

推荐答案

两种方法都可以使用OT来同步数据库的节点并替代Paxos / Zab / Raft吗?相似之处在于它们提供了最终的一致性。不同之处在于他们的操作方式。一种查看它的方法是:

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通过更改操作来做到这一点。操作是通过有线方式发送的,并发操作在收到后即被转换。

  • CRDT通过更改状态来实现。在本地CRDT上进行操作。其状态通过网络发送,并与副本状态合并。合并多少次或以什么顺序合并都无所谓-所有副本都收敛。

  • 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.

您是对的,OT是主要用于文本,并且早于CRDT,但是研究显示:

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


文献中的许多OT算法不能满足收敛性
,这与作者的说法不同

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

换句话说,CRDT合并是可交换的,而OT转换功能有时不是。

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

a href = http://en.wikipedia.org/wiki/Conflict-free_replicated_data_type rel = noreferrer>有关CRDT的维基百科文章:

From the Wikipedia article on CRDT:


OT通常是复杂且不可扩展的

OTs are generally complex and non-scalable

CRDT有不同种类(集合,计数器,。 ..)适用于各种问题。有一些是专为文本编辑而设计的。例如,Treedoc-用于合作编辑的交换复制数据类型

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.

这篇关于OT和CRDT之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆