← Back to context

Comment by marknadal

6 years ago

TLDR:

Local-first software is powered by CRDTs.

If you want to learn more about CRDTs, check out:

- https://github.com/automerge/automerge (author's project, legit)

- https://www.youtube.com/watch?v=yCcWpzY8dIA (deep technical talk)

- https://gun.eco/distributed/matters.html (my Cartoon Explainer)

OT also works fine for this sort of stuff. OT algorithms are easier to implement ([1] for an implementation I wrote of OT over arbitrary JSON structures). OT just requires a central source of truth / a central authority. For local first stuff depending on how you design it you can have one of those - in the form of your server.

[1] https://github.com/josephg/json1

  • Your work originally inspired me to get into this stuff. :)

    <3 thanks so much for your amazing contributions to OSS.

  • OT are inferior to CRDTs in every single way. In 2019 people shouldn't even be looking at OT.

    • I disagree. I think OT systems are way simpler to reason about, because they’re just an extension of event sourcing. Also CRDTs type implementations have been trailing OT algorithms in terms of features forever. OT got JSON editing support first, and JSON1 (the OT algorithm I linked above) also supports arbitrary tree reparenting, which as far as I know is missing from all CRDT algorithms. That’s needed to implement apps like workflowy, where you can drag trees around.

      CRDT algorithms have documents which grow without bound. With OT, the documents are always minimal and it’s easy to reason about (and implement) trimming operations.

      CRDTs are a better tool for distributed applications, but for server client stuff OT works fine.

      5 replies →