News for hackers. Stuff that matters.
Re:Using Postgres for Everything by ZitchDog on Monday May 20, 2024 @04:28PM (#40419917)
One thing that postgres does not solve very well is reactive UIs. Postgres does have listen/notify but it requires much more boilerplate and infrastructure to set up than Firebase/Firestore. For example I'd like to be able to run a query and get notified that the results have updated when any of the affected rows change.
Re:Using Postgres for Everything by samwillis on Monday May 20, 2024 @04:31PM (#40419961)
Solving this is high on my list with PGlite (https://github.com/electric-sql/pglite). I have a bunch of iteas/thoughts that I hope to get to at some point (IVM, streaming queries, result diffs).

When PGlite (or SQLite) is used with Electric (https://electric-sql.com/), we already provide good reactive primitives. But we hope to improve this so that where possible the full queries don't have to be re-run.

Re:Using Postgres for Everything by jamwt on Monday May 20, 2024 @05:25PM (#40420593)
Agree. If you want a fully reactive database (and not just hierarchy-based reactivity like Firebase) but want to keep your ACID + relational data modeling, check out https://convex.dev .

Plug notice: this is my company.

Re:Using Postgres for Everything by cpursley on Monday May 20, 2024 @05:01PM (#40420335)
Check out WalEx for this, it doesn't suffer from the character limits of listen/notify: https://github.com/cpursley/walex
Re:Using Postgres for Everything by SparkyMcUnicorn on Monday May 20, 2024 @04:33PM (#40419993)
I've been very happy using Hasura on top of pg.

There are several fantastic options that remove the need to manually write resolvers, set up subscriptions, solve N+1, reinvent the wheel, etc.

Re:Using Postgres for Everything by j45 on Monday May 20, 2024 @04:30PM (#40419959)
Could a simplification of reactive UIs be a possible angle?

Part of me is thinking about htmx or something from alpine and wondering if it’s enough. Shoutout to livewire too.

Re:Using Postgres for Everything by ZitchDog on Monday May 20, 2024 @04:33PM (#40419986)
Htmx doesn't help with this problem (knowing whether the underlying data has changed in order to update the UI). It's a common problem in any kind of collaborative app.
Re:Using Postgres for Everything by j45 on Tuesday May 21, 2024 @03:42AM (#40425249)
Have you tried Hasura by chance?