▲ | samwillis 3 days ago | |||||||||||||||||||||||||
This is a really great write up! I work at Electric and started the PGlite and now Tanstack DB projects. The issues mentioned with PGlite are one of the major motivating factors behind Tanstack DB. We are taking those learnings and building, what we believe, is the missing client side datastore that is "sync native" and completely backend agnostic. Also being JS, rather than WASM, solves many of the slower than ideal query semantics, and has enabled us to build an incremental query engine for it. It's also important to note that Electric doesn't require PGlite on the client, far from it - it's essentially a "protocol first" sync engine, you can use it to write into and maintain any client side store. This solution by the OP, diffing based of modified data is ideal for a huge number of apps, and something that we intend to built into Tanstack DB so you can easily sync with no additional infrastructure. SQLite (or PGlite) in the browser is awesome, and has the advantage over Tanstack DB at the moment of having persistence (it's on our roadmap), but they are also somewhat chunky downloads. For many local-first apps that's not a problem though. | ||||||||||||||||||||||||||
▲ | evelant 3 days ago | parent [-] | |||||||||||||||||||||||||
I built my own offline capable, multiplayer capable sync engine with pglite and electric https://github.com/evelant/synchrotron It is opinionated and not for every use case, also very experimental, but you might find some of the ideas interesting. | ||||||||||||||||||||||||||
|