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

[Feature Request] Please consider using a CRDT for syncing #134

Open
MayeulC opened this issue Nov 7, 2022 · 0 comments
Open

[Feature Request] Please consider using a CRDT for syncing #134

MayeulC opened this issue Nov 7, 2022 · 0 comments

Comments

@MayeulC
Copy link

MayeulC commented Nov 7, 2022

Conflict-Free Replicated Datatypes are a data type that can be synced at any point during the lifetime of the data, without causing conflicts. It is well-suited to collaborative editing where editing can be performed offline, or online, asynchronously or concurently, and merges can be performed without conflicts¹ or data loss at any point.

Have a look at https://www.inkandswitch.com/local-first/ for an intro on "local-first" software.

It's quite easy to find documentation on the subject. Here's one about Operational Transform vs CRDT: https://josephg.com/blog/crdts-are-the-future/

A widely-used library is y.js: https://github.com/yjs/yjs (link to docs), it has also been ported to other languages, like Rust and WASM, but I think js should be enough for Carnet?


I am proposing this since it's annoying to wait for Carnet to sync on start-up while it could be done later; it's a bit dangerous to edit notes offline in case of a conflict, and I lost a note content recently when trying to edit it before sync was done. I am not alone apparently: CarnetApp/CarnetFdroid#12

This would make collaborative editing possible (CarnetApp/CarnetAndroid#143), and offline editing easier, as well as reducing reliance on syncing (faster start-up and note opening). Multiple back-ends can also be used for syncing.


¹Conflicts still exist, obviously, but CRDTs ensure that they get resolved in the same manner on every client, and both versions prior to the conflict can be retrieved to present more choice to the user, if needs be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant