▲ | hakanshehu 4 days ago | |||||||
Nice post! I'm building an offline-first collaboration app and went on the route of building a custom sync engine, mainly because the app is open-source and I didn't want to introduce any dependency. I've implemented a simple cursor based sync with Postgres on server and SQLite in client side. Initially I built only a desktop client, because I didn't like IndexedDB. After the app got into HN, someone recommended to check for OPFS (Origin Private File System). Now we have a full offline-first app in web using SQLite on top of OPFS. We didn't test it with large scale yet, but so far looks very promising. The good thing is that we use Kysely as an abstraction for performing queries in SQLite which helps us share most of the code across both platforms (electron + web) with some minor abstractions. You can check the implementation in Github: https://github.com/colanode/colanode | ||||||||
▲ | jitl 4 days ago | parent [-] | |||||||
Depending on your data model, LiveStore is a completely open-source, SQLite based approach for local first sync-y apps: https://livestore.dev/ It's oriented around event sourcing and syncs the events, which get materialized into local table views on clients. It's got pretty slick devtools too. | ||||||||
|