-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using Automerge for syncing object across nodes #19
Comments
CRDTSo, the buzzword here is "Conflict-free replicated data type" (CRDT). It is a very cool concept and mechanism, and it may be useful for us. These tools are designed to allow data to diverge: edited by two or more parties, then synced later, say, after one of them comes back online. So it is ideal for apps that allow the user to continue working even if the connection to the server was lost, even for a longer time. The algorithms behind Automerge and Yjs are designed to never cause merge conflicts: it is always defined what will happen if two parties edit something near each other or even overlapping. I can see how this works for text-like data, but I'm not sure this is what you'd want for outline data: we intuitively know that some edits are incompatible, and there is no way to automatically resolve the situation without accepting one person's work will be (partially) lost. Perhaps something in-between is possible: automatically merge if there is no conflict at all, and always ask the user to review if there is a conflict. Automerge is cool in that it considers all objects to be immutable, and each mutation results in a new object. This is supposed to be done in an efficient way, but I'm curious how well it would perform with our kind of data (which is tree-like rather than sequence-like). I need to read more about how Yjs works. Some say it is faster than Automerge. Beyond collaborationThe mechanism is useful beyond (remote) collaboration:
CRDT and FontraOur immediate practical problem is that the official libraries are written in JavaScript (and Rust), and with our current architecture, we need it to work in Python, too. So that's a bit of a show-stopper for immediate experimentation. The alternative for Fontra is to make something ourselves, which would a huge rabbit hole. But then again, we could limit our requirements. For example:
This is much easier to achieve, but still requires us to build a lot of infrastructure. We could also say: we will initially have a more limited set of requirements, and intend to upgrade to a proper CRDT-based appraoch later. One question will be: how much work will be wasted by this two-step timeline? More links
|
From @davelab6 in #238 (comment): https://automerge.org/blog/automerge-2/ has impressive numbers, might be relevant |
https://automerge.org/
Thinking:
Question:
The text was updated successfully, but these errors were encountered: