Is your feature request related to a problem? Please describe.
It's very annoying when you have to reinvent the wheel for replication.
Describe the solution you'd like
Find an existing protocol that can be used to implement multi-device sync with a lot less effort.
Describe alternatives you've considered
Make a custom sync. Too much effort.
Make a simplified sync, like forcing you to pass around a lock when you switch devices. This is probably too cumbersome and feels underwhelming when other apps 'just work'.
Production ready
We seek acceleration - not a slowdown/distraction by a sea of bugs or hard-to-explain behavior.
Open Source, with preferably a strong copyleft license
This is to avoid usurpation/exploitation for commercial means once the project reaches a certain maturity/adoption level.
State-based
There are two types of CRDTs, state-based and operation-based.
Providing a middleware layers that guarantees reliable, exactly once and in-order delivery is not possible, so we can only use state-based solutions. The drawback of state-based is replicating the whole object every time - which is not a big deal since we don't have big mutating objects.
This means states are merged by a function which must be commutative, associative, and idempotent. The outstanding question is whether we also want all state history - or simplify the algorithm and data transfer load by just focussing on the most recent state (Delta state CRDTs).
Also:
The sync mechanism could also be used to backup a password-encrypted version to a trusted peer. If you do my backup - I'll do yours. Typically you'll want to choose someone other than your partner too, to avoid physically co-locating all the data and backups.
Side note:
Any Event Sourced system qualifies as using Commutative CRDT (CmRDT), since it's a Grow-Only set, like G-Set, at least under the condition that the events are representing operations and are modeled in such a way that order in the stream does not matter. Under these conditions it is mathematically proven that any conflict within the stream can also be resolved.
Is your feature request related to a problem? Please describe. It's very annoying when you have to reinvent the wheel for replication.
Describe the solution you'd like Find an existing protocol that can be used to implement multi-device sync with a lot less effort.
Describe alternatives you've considered
Additional context Some ideas:
CRDT requirements:
This is to avoid usurpation/exploitation for commercial means once the project reaches a certain maturity/adoption level.
There are two types of CRDTs, state-based and operation-based.
Providing a middleware layers that guarantees reliable, exactly once and in-order delivery is not possible, so we can only use state-based solutions. The drawback of state-based is replicating the whole object every time - which is not a big deal since we don't have big mutating objects.
This means states are merged by a function which must be commutative, associative, and idempotent. The outstanding question is whether we also want all state history - or simplify the algorithm and data transfer load by just focussing on the most recent state (Delta state CRDTs).
https://nextgraph.org/ looks promising but not production ready
There's a few more suggestions on https://restoration.software/posts/peer-to-peer-architecture-research/:
https://nostr.com/
https://tech.anytype.io/any-sync/overview
https://odd.dev/
https://p2panda.org/
https://socketsupply.co/
https://spritely.institute/ https://willowprotocol.org/
https://braid.org/antimatter
https://lofi.re/
https://smolweb.org/
https://www.w3.org/TR/activitypub/
https://veilid.org/
Hyphanet, GNUnet, SSB Matrix-based:
Also:
The sync mechanism could also be used to backup a password-encrypted version to a trusted peer. If you do my backup - I'll do yours. Typically you'll want to choose someone other than your partner too, to avoid physically co-locating all the data and backups.
Side note:
Any Event Sourced system qualifies as using Commutative CRDT (CmRDT), since it's a Grow-Only set, like G-Set, at least under the condition that the events are representing operations and are modeled in such a way that order in the stream does not matter. Under these conditions it is mathematically proven that any conflict within the stream can also be resolved.