Hacker News new | past | comments | ask | show | jobs | submit login

I've read a couple of CRDT papers but never used them in anger. (Zero interest in collaborative text editing, but a lot of interests in multi-master systems involving local databases that lose internet connectivity).

Anyone have any good war stories? The general impression I get is that anything more than a state delta two-phase set is an open research problem to implement efficiently - the papers make it sound pretty straight forward but there's a whole garbage collection problem to deal with, there was another research paper dealing with just that IIRC.




Raph Levien had a good post about using CRDTs for text editing. He feels they didn’t live up to his expectations.

https://raphlinus.github.io/xi/2020/06/27/xi-retrospective.h...


It's interesting to me that people still doubt that CRDTs can be used in practice. The fact is that they are already being used in practice by many companies with millions of users for applications like rich-text editing and state management in 3d applications. See https://github.com/yjs/yjs#who-is-using-yjs

In fact, Yjs - a CRDT implementation- is the most downloaded solution for collaborative applications. Even more than ShareDB (the most popular OT-based solution).

Yjs ~90k/week - https://www.npmjs.com/package/yjs

ShareDB ~13k/week - https://www.npmjs.com/package/yjs


Chris McCord had fun implementing a CRDT in Phoenix.Presence: https://www.youtube.com/watch?v=XJ9ckqCMiKk (from about 17 mins by the looks of things).



I implemented and deployed a state synchronization protocol based on CRDTs at my last job. It replaced a protocol that needed a fully connected mesh to function properly, and the entire cluster would suffer a grey failure if a connection was broken or slow. The new protocol was much more resilient, and was able to take advantage of the transitive property of state-based CRDT operations.

My solution for garbage collection was pretty boring. Occasionally, a JSON file was rsynced to each service node with the 'true' state of the system at some time in the past, and the CRDT maintained the new state on top of that JSON file, until the next file got rsynced.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: