Re:Logseq – adding settings for self-hosted sync
by mweidner on Tuesday July 16, 2024 @08:17PM
(#40981485)
You can store a text-editing CRDT's state in a standalone file instead of in a database. However, it is hard to make the file human-legible or updateable. The best you could do is probably something like a piece table (https://en.wikipedia.org/wiki/Piece_table), or the plain text followed by some opaque CRDT metadata.
If you want to preserve the ability to edit plain text files using an arbitrary program, your sync engine could be a file watcher that computes a diff each time the file is saved - like git does, but character-based instead of line-based.
I wonder if a database is required for CRDTs. I don't know if logseq use that, but if we had a FOSS note-taking app with CRDTs, we might have to give up the text format.