I have a question about Automerge that maybe someone here can answer. I have a lot of code written for some custom CRDTs I've made. (This handles syncing them with my server and between devices and so on.) My data model is that each device gets a unique ID, and then can share "events" which must be sequential for a given ID. The events from all the different devices are then collected and replayed. I'm curious if it would be possible to fit automerge to this framework? All I would need is an `apply` function that takes an event and a document and produces a new document. (I assume I would miss out on the super-efficient compressed representation described in this article, but I'm curious)
Replaying immutable events in a deterministic order doesn't fit so well with Automerge; Automerge is more designed for apps where you can represent the mutable state of your application as an Automerge doc. https://livestore.dev/ might be a better fit for you.
I’m also interested in this. I have a similar use case, to implement “cross device sync” functionality for a local-only webapp. I tried out automerge but it felt like it’s meant for syncing data when multiple users collaborate, and not data sync for a single user who is expected to use only one device at a time (I could be wrong about this).
I have implemented a POC sync mechanism via central server and I believe it’s simpler as it takes advantage of certain assumptions about the app. I’ve yet to productionize it so I am interested in knowing if my understanding is correct or if there are other existing solutions for this use case.
I am in somewhat of the same boat for https://parture.org. Have a quite large CRDT system with unique ID's that is also type-safe, does not rely on serde_json::Value juggling, every CRDT is structurally valid and it knows what CRDT's cannot be applied to a Rust struct based on some business logic. I am wondering whether such checks (type-safety, business logic) can be worked into the CRDT application process. Automerge seems mostly meant for text editing, but they do have Autosurgeon though it hasn't been updated in a while