gpt4 book ai didi

conflict - Meteor 中的 Etherpad 风格同步?

转载 作者:行者123 更新时间:2023-12-04 10:41:22 25 4
gpt4 key购买 nike

研究 Meteor 来创建一个协作文档编辑应用程序,因为 Meteor 默认在多个客户端之间同步数据非常棒。

但是当使用文本区域时,就像在 Sameer Kalburgi 的例子中一样
http://www.skalb.com/2012/04/16/creating-a-document-sharing-site-with-meteor-js/
http://docshare-tutorial.meteor.com/
体验是次优的。

我试图与一位同事同时打字,当她打字时我的更改会被覆盖,反之亦然。所以在冲突解决中还没有合并算法,我想?

这是为该功能计划的吗?目前有没有办法实现这一点? Etherpad 似乎很好地处理了这个问题。在 Meteor 中拥有它将使创建协作文档编辑应用程序变得更容易。

最佳答案

所以我进一步研究了它,在 Etherpad 中使用的算法被称为操作转换:

The solution is Operational Transformation (OT). If you haven’t heard of it, OT is a class of algorithms that do multi-site realtime concurrency. OT is like realtime git. It works with any amount of lag (from zero to an extended holiday). It lets users make live, concurrent edits with low bandwidth. OT gives you eventual consistency between multiple users without retries, without errors and without any data being overwritten.

Unfortunately, implementing OT sucks. There's a million algorithms with different tradeoffs, mostly trapped in academic papers. The algorithms are really hard and time consuming to implement correctly. We need some good libraries, so any project can just plug in OT if they need it.



这是来自 sharejs 的网站.基于 node.js 的 ot 服务器客户端,您可以将其挂接到现有客户端。

OT 也在 Node.js 的 Racer 模型同步引擎中实现,它构成了 Derby 的基础。目前,derby.js 还没有透明地提供它,但他们也在计划,来自 Derby docs :

Currently, Racer defaults to applying all transactions in the order received, i.e. last-writer-wins. (…) Racer [also] supports conflict resolution via a combination of Software Transactional Memory (STM), Operational Transformation (OT), and Diff-match-patch techniques.

These features are not fully implemented yet, but the Racer demos show preliminary examples of STM and OT.



巧合的是,sharejs 和 derbyjs 团队都有一位前 Google 浪客。 Meteor 的核心团队中有一个前etherpad/Google Waver。由于 Etherpad 是最著名的 OT 实现之一,我想象 Meteor 肯定也会在某个时候支持它……

关于conflict - Meteor 中的 Etherpad 风格同步?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11956021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com