Hacker News new | ask | show | jobs
by tylerhou 2791 days ago
It's possible and there has been research in this area, see http://archagon.net/blog/2018/03/24/data-laced-with-history/ for details about conflict resolution.

The main problem is garbage collection - to guarantee that you can sync across all devices for all time, your data structure must be append-only, so your document can only grow. A long living document will eventually grow very very large. You could let the user decide when to collect garbage/establish a new baseline doc; maybe like 5 years. But this means that if you edited the document on a laptop, didn't sync it with another client, and then closed the laptop for 5 years you would lose the ability for the changes you made on that laptop to be resolved automatically.

1 comments

Just use a CRDT
That's what I'm suggesting, but I'm pointing out the fact that CRDTs are generally append only data structures and it's possible to run into space issues with them eventually for some users.
A lot of CRDTs are append-only.

But not all! Quite a few that are state-based, auto-compacting, space-saving, small & efficient!

More info in a discussion on this: https://twitter.com/marknadal/status/1008610024875122688

A CRDT which models edits of arbitrary text with essentially unbounded revision history (required for merging) almost certainly can only grow (monotonically?) in size. Maybe you can be smart about compression, but I don't think it can ever shrink. Someone smarter than me can probably formally prove this with an argument about entropy while considering a series of particularly pathological edits.

But you're right that I'm wrong when I say "[all] CRDTs are generally append only structures." I meant to say "text-revision CRDTs are generally append only data structures."