Skip to content
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

Store text documents and CRDT state in file-system #31

Open
adzialocha opened this issue Jan 17, 2025 · 0 comments
Open

Store text documents and CRDT state in file-system #31

adzialocha opened this issue Jan 17, 2025 · 0 comments
Labels
backend p2p networking, p2panda, etc. crdt Text-CRDT handling, data types, etc. frontend GTK, User Interface, UX, etc.

Comments

@adzialocha
Copy link
Member

adzialocha commented Jan 17, 2025

We want to persist multiple things per document:

  1. Document hash (for p2p networking)
  2. The text itself
  3. State-based CRDT / "snapshot" data inside of p2panda operation

There's different ways to approach it, but here's a rough idea:

  1. Users can "Import" any text document into Aardvark, they will not have a document hash yet, another option is to simply just create a "New" one
  2. In the moment they share it with other peers (through actively going through the "Share" flow) they get an document hash assigned
  3. By default this document gets now stored in a hidden place with some markdown frontmatter holding the extra information to allow p2p networking:
    ---
    document_id: "7aa0c9a6e17e4eae7e5d490d83c0136d6047ffb4d37e201f3c1e57d198e4bcc7"
    ---
    
    # My text document
    
    Hello!
  4. CRDT data is stored in an SQLite database next to these markdown documents, we simply map the document_id to the CRDT snapshot (only one required per document)
  5. For now we can have an "Export" option which would allow users to save the document without the frontmatter. They'll loose the shared, collaborative meta-data for it and would need to re-share it again if they decided to re-import it again
@adzialocha adzialocha added backend p2p networking, p2panda, etc. crdt Text-CRDT handling, data types, etc. frontend GTK, User Interface, UX, etc. labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend p2p networking, p2panda, etc. crdt Text-CRDT handling, data types, etc. frontend GTK, User Interface, UX, etc.
Projects
None yet
Development

No branches or pull requests

1 participant