Operational Transformation library?

前端 未结 14 881
醉酒成梦
醉酒成梦 2020-11-27 09:00

I\'m looking for a library that would allow me to synchronize text in real-time between multiple users (ala Google Docs).

I\'ve stumbled upon Operational Transformat

相关标签:
14条回答
  • 2020-11-27 09:26

    OT Libraries:

    • https://github.com/sveith/jinfinote
    • https://github.com/jvanveen/py-infinote

    Within the HWIOS websocket project, i've succesfully used a combo of both(py-infinote at the serverside, jinfinote at clientside) to sync document states.

    0 讨论(0)
  • 2020-11-27 09:26

    We're building a collaborate editor that combines Operational Transformation with versioning. That way we can support both, offline and online collab. We released our own OT library yesterday as part of our open source stack.

    http://interior.substance.io/modules/operator.html

    We've also contributed a library for versioning.

    http://interior.substance.io/modules/chronicle.html

    0 讨论(0)
  • 2020-11-27 09:29

    I think that parts of Google Wave's OT implementation are Open Source (and more parts are coming).

    I'm not sure if this is what you are looking for, but an alternative to OT is Differential Synchronization:

    • Google-Diff-Match-Patch - Diff, Match and Patch libraries for Plain Text: "The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text."
    • Google-MobWrite - Real-time Synchronization and Collaboration Service: "MobWrite converts forms and web applications into collaborative environments. Create a simple single-user system, add one line of JavaScript, and instantly get a collaborative system." (Uses Google-Diff-Match-Patch.)
    0 讨论(0)
  • 2020-11-27 09:29

    With a js client lib (Strophe.js) you could use a free XMPP server (like jabber.org) along with my client-side OT lib (JSOTTEST) to build a complete client-server system.

    I will submit the src of a demo client-server chat system when I have time to revise the code.

    0 讨论(0)
  • 2020-11-27 09:36

    I'll summarize the solutions I found.

    • Operational Transformation: E.g.

      • Google Wave OT. The approach is based on the so called Jupiter approach.
      • ShareJs. Based on the same OT algorithm as Google Wave OT.
      • Coweb-jsoe. Based on COT - a very sophisticated OT approach that also supports p2p message propagation.
      • OpenCoweb. It leverages OpenCoweb-jsoe in order to provide a full-fledged Framework for a lot of similar problems.
      • OT.js is based on the operation-types of ShareJs.
      • DriveSDK. A very interesting API that can do a lot of things - e.g. collaboration on graphs.
      • SwellRT is a Fork of Apache Wave. Is is federated, and supports rich text.
    • Differential Synchronization:

      • Diff-Match-Patch from Neil Fraser.
      • MobWrite leverages the Diff-Match-Patch algorithm.
    • CRDT (Commutative Replicated Data Type):

      • There are a lot of different CRDT algorithms that allow the implementation of shared types. Some CRDTs work with P2P message propagation, some rely on client-server models
      • Yjs allows you to share arbitrary data types (RichText, Array, Hash Maps, .. extendable). Offline support and support for P2P communication protocols (there are modules for XMPP, Websockets, and WebRTC)
      • SwarmJS Client server shared database with offline support. Works well with React
      • Woot An implementation of the Woot CRDT
      • CRDT Another CRDT implementation
      • Automerge
    0 讨论(0)
  • 2020-11-27 09:38

    Npm has some nice ot libraries for node.js:

    • https://npmjs.org/package/ot -- adapters for codemirror and ace built in as well as a client and server implementation
    • https://npmjs.org/package/changesets -- plain ot library usable in node and the browser; allows you to build 'changesets' (essentially diffs) that you can send around, transform against each other and apply on a document
    0 讨论(0)
提交回复
热议问题