流星中的Etherpad样式同步? [英] Etherpad style synchronisation in Meteor?

查看:127
本文介绍了流星中的Etherpad样式同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望使用Meteor创建一个协作式文档编辑应用程序,因为Meteor默认情况下可以在多个客户端之间同步数据。

Looking into Meteor to create a collaborative document editing app, because it’s great that Meteor synchronizes data between multiple clients by default.

但是当使用文本区域时,例如在Sameer Kalburgi的示例中

http://www.skalb.com/2012/04/16/creating-a-document-sharing-site-with-meteor-js/

< a href = http://docshare-tutorial.meteor.com/ rel = noreferrer> http://docshare-tutorial.meteor.com/

经验是次要的最佳。

But when using a text-area, like in Sameer Kalburgi’s example
http://www.skalb.com/2012/04/16/creating-a-document-sharing-site-with-meteor-js/
http://docshare-tutorial.meteor.com/
the experience is sub-optimal.

我尝试与一位同事同时键入内容,而当她键入内容时,我的更改将被覆盖,反之亦然。因此,我认为在冲突解决方案中还没有合并算法?

I tried to type at the same time with a colleague and my changes would be overwritten when she typed and vice versa. So in the conflict resolution there is no merge algorithm yet, I think?

这是针对该功能计划的吗?目前有什么方法可以实现吗? Etherpad似乎可以很好地处理此问题。在Meteor中拥有此功能将使创建协作文档编辑应用程序的方式更易于访问。

Is this planned for the feature? Are there ways to implement this currently? Etherpad seems to handle this problem rather well. Having this in Meteor would make creating collaborative document editing apps way more accessible.

推荐答案

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

So I looked into it some more, the algorithm used in Etherpad is known as Operational Transformation:


解决方案是操作转换(OT)。如果您还没有听说过,那么OT是一类执行多站点实时并发的算法。 OT就像实时git。它可以处理任何延迟(从零到延长假日)。它允许用户以低带宽进行实时并发编辑。 OT使您最终可以在多个用户之间保持一致性,而无需重试,没有错误并且没有任何数据被覆盖。

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.

不幸的是,实现OT很烂。有上百万种算法需要权衡取舍,而大多数算法都被困在学术论文中。要正确实现这些算法确实非常困难且耗时。我们需要一些好的库,因此任何项目都可以在需要时插入OT。

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服务器-客户端。

Thats’s from the site of sharejs. A node.js based ot server-client that you can hook into your existing client.

OT也在Node.js的Racer模型同步引擎中实现,该形式德比的基础。目前,derby.js尚未透明地提供它,但它们也可以从 Derby文档

OT is also implemented in the Racer model synchronization engine for Node.js, that forms the underpinnings for Derby. At the moment, derby.js doesn’t transparently provide it yet, but they plan too, from the Derby docs:


当前,Racer默认情况下按照收到的顺序应用所有交易,即最后作家获胜。 (…)Racer [也] 通过软件事务存储(STM),操作转换(OT)和Diff-match-patch技术的组合来支持冲突解决。

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.

这些功能尚未完全实现,但是Racer演示演示了STM和OT的初步示例。

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

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

Coincidentally, both the sharejs and derbyjs teams have an ex Google-waver on board. Meteor has an ex etherpad/Google Waver in their core team. Since Etherpad is one of the best known implementations of OT I was imagining Meteor would surely want to support it at some point as well…

这篇关于流星中的Etherpad样式同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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