▲ | AlienRobot 4 days ago | |||||||
I feel like the problem is simply... it should just be a file. And if it were a file, you could sync it with dropbox or OneDrive. And if you can do that, they can't make money selling their own cloud service for their local-first app. More specifically, if you can edit different parts of a same document on different devices, then the document should be split across multiple files that can be synced independently, e.g. a photoshop document where each layer is a separate file and a "main" document simply loads them into a single layer stack. In fact there are too many document types nowadays that are composites of sub-files and are even actually just a zipped folder under the hood. It feels like we should have just been using files all along, or some sort of file-folder hybrid with OS-level support instead of using zipped folders to contain all the files of a single document. | ||||||||
▲ | mweidner 4 days ago | parent | next [-] | |||||||
> More specifically, if you can edit different parts of a same document on different devices, then the document should be split across multiple files that can be synced independently A more robust idea is to store a log of changes in files that are synced with Dropbox/OneDrive/etc. To prevent conflict warnings from Dropbox, you'll want each device to write to a separate file. Readers re-assemble the logs into (some) canonical total order, then reduce over that to get the document state. The hard part is re-architecting your app to record all changes, instead of just writing out the current state to disk. However, once you do that, it can form the basis for other features like undo/redo, a view of the file's history, etc. (The changes don't need to be CRDT/OT messages - anything deterministic works, though it's a good idea to make them "rebase-able", i.e., they will still do something reasonable when replayed on top of a collaborator's concurrent changes.) | ||||||||
▲ | MangoToupe 4 days ago | parent | prev [-] | |||||||
> And if it were a file, you could sync it with dropbox or OneDrive. How do these services resolve conflicts? | ||||||||
|