4 ms·
Does it support character level collaboration (like Google docs) or is this just generic entry/line level sync? IIRC CRDTs do not work well for Google-docs type
by ampdepolymerase 5y ago
Does it support character level collaboration (like Google docs) or is this just generic entry/line level sync? IIRC CRDTs do not work well for Google-docs type text editing because they cannot capture intent well.
- sambigeara 5y agoCurrently it's at an entry/line level like you suggest, although theoretically I could flip (for lack of a better term) the algorithm and apply it laterally on a per character basis. The data structure is a WAL storing all mutation events, each of which has a reference to another uniquely identifiable item (by some UUID:timestamp combo). Rather than treating each line as a uniquely identifiable object, I could treat each character as such. Downside of the current implementation is that two people operating offline on the same line will see unpredictable results when they're able to sync again (basically it will just honour the most recent update event). The per-char change above would remedy that, I think!
- sambigeara 5y agoActually, I'm intrigued by what you mean by this: > IIRC CRDTs do not work well for Google-docs type text editing because they cannot capture intent well. Could you elaborate? Appreciate the discussion
- ampdepolymerase 5y agoThey don't capture semantic intent that well compared to Operational Transforms when conflict arises. https://www.tiny.cloud/blog/real-time-collaboration-ot-vs-crdt/ https://www.tiny.cloud/blog/real-time-collaboration-ot-vs-cr... Some teams also encountered engineering problems using them. https://news.ycombinator.com/item?id=24186883 https://news.ycombinator.com/item?id=24186883 Done properly however, they can be magical. http://archagon.net/blog/2018/03/24/data-laced-with-history/#demo-concurrent-editing-in-macos-and-ios http://archagon.net/blog/2018/03/24/data-laced-with-history/...
- sambigeara 5y agoAh, I understand. Fascinating stuff - thanks for sharing. Food for thought when considering how to evolve the app (e.g. moving beyond just plain text).
- rkallos 5y agoDefinitely a tricky problem for CRDTs. A possible solution is outlined in the OpSets paper; https://arxiv.org/abs/1805.04263 https://arxiv.org/abs/1805.04263 I hope that there are existing implementations of OpSets that perform well. I find the solution laid out in that paper to be really elegant and beautiful.
- sambigeara 5y agoAwesome - thanks for sharing
- dnautics 5y agoCheck out martin kleppmans YouTube video on YouTube: crdts: the hard parts
- sambigeara 5y agoMassive fan of his work! Thanks for sharing
- dnautics 5y agoThis video specifically goes over why most crdts are inappropriate for collaborative text editing and shows off a plausibly useful crdt.