It feels like everyone is solving the sync problem from a slightly different angle. Has anyone here used a few of these in production?
We use very similar solution in https://reflect.app Using the wa-sqlite library, and our own Mobx-based model layer similar to what Linear does. I gave a short talk about it a few months ago https://www.youtube.com/watch?v=b0GKWzeyZko
Lessons learned from building a sync-engine and reactivity system with SQLite
11–20 of 41 posts
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#12Ok is this about a reactive app with with a local database automatically synced to a remote db? All fully encrypted (at rest and in transit)? I thought this is what everyone does nowadays! We built an app like this in 2019 - yes - it was a bit of a challenge with the encryption but the „syncing data“-part is what every litte multiplayer-game has to deal with like forever now. Seems i‘m out of touch with the current s…
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#13Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#14> And because Electric syncs every change granularly, you are certain that the state of your local database is exactly the same as the server's. I don't see how this certainty follows from "granularity" (whatever that means in this context). I believe to have such a certainty one would need the synchronization to happen within a single transaction that spans both client and server databases.
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#15It mirrors the moment I embraced tools like Obsidian; designing for real-world constraints; valuing simplicity, privacy, and functionality; especially in low‑connectivity environments.
PS: I was hooked on ...SQLite
Bravo!
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#16Not so sure about this. These seem more like fundamentals than sliding scales.
> How many people will concurrently edit the same resources?
More than 1.
> How write-heavy is it?
Write-heavy enough that you'll encounter an unexpected write between two reads.
> Can you expect unreliable connections or offline usage?
Yes.
CAP with Electron and SQLite is no different from CAP with Tauri and MySQL.
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#17> And because Electric syncs every change granularly, you are certain that the state of your local database is exactly the same as the server's. I don't see how this certainty follows from "granularity" (whatever that means in this context). I believe to have such a certainty one would need the synchronization to happen within a single transaction that spans both client and server databases.
Correct - granular syncing alone doesn't guarantee consistency; you'd need either a distributed transaction protocol or a conflict resolution strategy with eventual consistency semantics.
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#18very cool! have you tried Tanstack DB and ElectricSQL? https://x.com/marcelohbairros/status/1956892684859158892
> First Try: PGlite and Electric
Re: Lessons learned from building a sync-engine and reactivity system with SQLite
#19Out of curiosity, apart from the lack of LISTEN support what more did you miss in SQLite itself and its ecosystem?