5 ms·
Several interesting open source projects are working with CRDTs to make state synchronization in distributed systems an easier problem to deal with: - Braid
by canadaduane 7y ago
Several interesting open source projects are working with CRDTs to make state synchronization in distributed systems an easier problem to deal with:
- Braid HTTP (https://braid.news/)
- Automerge (https://github.com/automerge/automerge)
- Gun (https://gun.eco/)
- Yjs (http://y-js.org/)
- Noms (https://github.com/attic-labs/noms)
- DAT (https://dat.foundation/)
Personally, I'm most excited for Braid's effort to bring state sync to HTTP through the IETF process, as well as Automerge's progress in P2P via Hypermerge (and it's star app, Pushpin). I'd also like to see Gun succeed, but have had a hard time getting started due to visually distracting quirks in its documentation.
- brianzelip 7y agoNot open source, but also Actual, a personal budgeting app made by James Long, the author of Prettier. Cool stuff for sure. Here’s an insightful podcast about Actual (hosted by the author of Tailwind.css), http://www.fullstackradio.com/126 http://www.fullstackradio.com/126
- lucidstack 7y agoHorde [0] is a really interesting Elixir library for distributed, self-healing state using CRDT [0]: https://github.com/derekkraan/horde https://github.com/derekkraan/horde
- qohen 7y agoHorde is indeed a really interesting Elixir library. It's based on the CRDT library, DeltaCrdt [0], also by Derek Kraan. He discusses DeltaCrdt here [1] and Horde here [2]. BTW, Horde is a distributed supervisor, i.e. analogous to what regular Elixir OTP supervisors do, except that it can restart processes on different cluster nodes. It also provides a distributed process registry. Daniel Azuma of Google gave a great 39 minute talk at ElixirConf 2018, "Docker and OTP: Friends or Foes?" [3], where he shows Horde (and DeltaCrdt) in action to keep a multi-player tank video game going while the Docker container it's running in gets killed and and the Elixir processes get respawned on another container. The state is persisted across Elixir nodes in other containers in an instance of DeltaCrdt. (Again, the talk is really good -- if the above sounds interesting, you'll want to check it out [3]). [0] https://github.com/derekkraan/delta_crdt_ex https://github.com/derekkraan/delta_crdt_ex [1] https://moosecode.nl/blog/how_deltacrdt_can_help_write_distributed_elixir_applications https://moosecode.nl/blog/how_deltacrdt_can_help_write_distr... [2] https://moosecode.nl/blog/introducing_horde https://moosecode.nl/blog/introducing_horde [3] https://www.youtube.com/watch?v=nLApFANtkHs https://www.youtube.com/watch?v=nLApFANtkHs
- Cogitri 7y agoXi-editor also uses a CRDT to merge incoming editing events
- AriaMinaei 7y agoXi experimented with using CRDTs to merge state changes produced by plugins running asynchronously on different threads, but they decided that it was a failed experiment.
- raphlinus 7y agoI think that's overstating it a bit. What I would say is that the CRDT added a lot of complexity, and we weren't able to encapsulate that complexity into an "engine" as was originally hoped. Previous HN discussion on the mini-retrospective might be interesting: https://news.ycombinator.com/item?id=19886883 https://news.ycombinator.com/item?id=19886883
- AriaMinaei 7y agoThanks for the correction! Is it more accurate to say that in Xi, CRDTs ended up leaking too much complexity for the purpose of synchronizing state between async components of the editor (like plugins) that run on the same machine, but not necessarily for the purpose of collaborative editing between users where there is significant latency?
- raphlinus 7y agoI think that's fair. We had an experimental collaborative editing prototype running on Fuchsia, but that was never officially part of the scope of the project. So this is all about whether technology developed for multiuser collaboration is helpful for the single user case. A good example is inserting indentation in response to, say, the "Enter" key. In a synchronous model, this is pretty straightforward. You calculate the indentation as essentially a function of the contents of the buffer and the delta (the insert of the newline), then any other typing gets processed after that. In a CRDT model, the additional typing can be interleaved in any order, and the merge operation has to converge to the correct results. You can think about how bad that is: the user could type a hundred lines of code, complete with complex editing operations including cut and paste, deletions, undo, and then the auto-indent plugin wakes up, calculates the diff, and sends it to the core. Meanwhile, the user has typed another hundred lines, including more cut'n'pasting of the affected lines. This is perhaps unrealistic, but the CRDT model requires it. And I think it is possible to solve it (I wrote some "rope science" articles, then there was more discussion in several issues), but it's a hugely intricate puzzle compared with just applying it synchronously, and the benefit is not worth it. It's quite practical to compute indentation for any realistic source file in under a millisecond, if you've got a nice fast language.
- lelf 7y agoAnd https://riak.com https://riak.com
- toolz 7y agohttps://lasp-lang.readme.io/docs https://lasp-lang.readme.io/docs is another very interesting project that makes heavy use of many different CRDTs
- bessarabov 7y ago- ff — A distributed note taker and task manager — https://github.com/ff-notes/ff https://github.com/ff-notes/ff
- rogerclark 7y agoGun is also very unstable, and all of the support projects (superpeers etc) are skeletal at best. it's not usable for production applications yet
- marknadal 7y agoAuthor here. GUN is running in production with 8M monthly users. On large sites like HackerNoon and with Internet Archive. What makes you say it is unstable? If there is anything, please report it and we'll get it fixed. Edit: Re grandparent: Will try to add "dark mode" to docs, in meanwhile, check out the docs on plain-text GitHub wiki ( https://github.com/amark/gun/wiki/Graph-Guide https://github.com/amark/gun/wiki/Graph-Guide ) which is where everything pull from anyways.
- canadaduane 7y agoThanks for your gracious reply, Mark. Your humanity-first approach to everything, as well as the the Gun community are what make it so very promising to me.
- woah 7y agoThanks for the great comment, Steve. Comments like this humble and uplift me as I think of all the things that the GUN community will accomplish together.
- rch 7y agoAkka also provides some CRDT based distributed data capabilities: https://doc.akka.io/docs/akka/current/typed/distributed-data.html https://doc.akka.io/docs/akka/current/typed/distributed-data...
- lichtenberger 7y agoI think Automerge from Martin Kleppmann is super interesting :-) However, as he told me a more sophisticated persistence layer is needed. Looking forward how it's emerging
- fyp 7y agoHe gave several talks on CRDTs which are good intros: https://www.youtube.com/watch?v=B5NULPSiOGw https://www.youtube.com/watch?v=B5NULPSiOGw https://www.youtube.com/watch?v=yCcWpzY8dIA https://www.youtube.com/watch?v=yCcWpzY8dIA
- lichtenberger 7y agoYes, I saw them. Also his book is one of the best computer science books I've read and he gave me a really good advise for my own Open Source project, regarding the use of BookKeeper as a distributed log (instead of Kafka) :-)
- api 7y agoLF uses a giant all-encompassing DAG as a CRDT and implements subjective name conflict resolution by computing "views" of the DAG based on various weighting constraints: https://github.com/zerotier/lf https://github.com/zerotier/lf It's a bit like Riak or etcd but can be used across organizational and trust boundaries similar to e.g. a cryptocurrency. Anyone can run LF as part of the same network and both data privacy and security are maintained.
- Rapzid 7y agoDoes anyone know what CRDT/OT library the VSCODE LiveShare extension uses?
- lewisl9029 7y agoNot sure about VSCode's implementation, but Atom's teletype uses this: https://github.com/atom/teletype-crdt https://github.com/atom/teletype-crdt
- lewisl9029 7y agoThe IPFS folks also have an excellent compilation of resources on CRDTs available here: https://github.com/ipfs/research-CRDT https://github.com/ipfs/research-CRDT