Remix.run Logo
_fzslm 4 hours ago

I'm so optimistic about this, especially in the context of local-first web applications. With Postgres on both the client and the server, and something like PowerSync or ElectricSQL to keep the two together, you get a homomorphic database environment between client and the server. That has a lot of architectural benefits I'm actively exploring. The client and the server can share a lot more code, for one.

But I read the following posts, and I have some serious concerns about PGlite's performance:

https://antoine.fi/sqlite-sync-engine-with-reactivity – describes memory leaks, minute-long db startup time, and huge slowdowns with live queries

https://github.com/marcus-pousette/sqlite3-bench - shows performance dropping to multi-second territory for inserts and lookups, compared to sqlite which is significantly faster

It sadly makes me slightly skeptical about adopting what effectively feels like a hack... SQLite has obviously had decades of adoption and I'm not expecting PGlite to match that level of legacy or optimisation - but it's enough to give me pause.

I really, really want to adopt PGlite in a project I'm currently architecting, so would love some insight on this if anybody has any!