3 ms·
Postgres is amazing, but there are some issues you quickly hit with systems like this: 1. Side effects: Want to send an email when something happens 2. condit
by madsbuch 4y ago
Postgres is amazing, but there are some issues you quickly hit with systems like this:
1. Side effects: Want to send an email when something happens
2. conditional permissions: Need access to data under certain circumstances not modelled by the security language?
3. Subset access: Access to parts of the row / document.
4. Aggregate access: Access to eg. a count of rows you can not access.
These are usually solved using serverless functions – or an API written in code.
Personally I err to the side of just writing some code, maybe because I enjoy that part of the project. Then I might be more inclined to use no-code solutions for the frontend, where others want the freedom and flexibility.
- cpursley 4y agoSupabase handles all of this. I handle #1 with by listening to database changes then reacting as needed with a change capture / event-like system: https://github.com/cpursley/walex https://github.com/cpursley/walex
- giraffe_lady 4y agoDoes supabase do anything particular to address those or just hand you postgres's RLS? It's been a minute since I used supabase but when I last did you were basically on your own with that. Which is not necessarily bad, RLS is sophisticated enough to handle all real world cases I've come across. But if it's just that I think it's more correct to say postgres already handles all of this.
- discreteevent 4y agoThe problem with event driven systems is that they can end up being a kind of spaghetti. It can be hard to track down all the side effects. There's no place where you can read some code to see what happens sequentially.