3 ms·
We're currently developing a Supabase app that's backed by PostgREST. For our MVP, we built out everything that we could in SQL procedures (they're honestly no
by pzduniak 5y ago
We're currently developing a Supabase app that's backed by PostgREST.
For our MVP, we built out everything that we could in SQL procedures (they're honestly not that terrible, especially in Postgres, just a bit verbose), we could also use `pgv8` and write them in JavaScript. If we need to trigger some special logic, we push data through webhooks to another service that also has access to the database. It works, but it's kind of messy and I'm somewhat worried about the performance of the HTTP client bundled with Postgres. This mechanism could also be implemented with the `LISTEN`/`NOTIFY` interface.
It feels like the better way to do it is having an API gateway / a separate API accepting the same JWT requests as PostgREST and others. We'll try it for our next project and maybe we'll migrate this product too, if we run into any issues with HTP requests.
It's been great for CRUD-heavy apps. Optimizing the RLSes sometimes gets tough, but you can always work around them with views / functions that avoid them.
- dinkleberg 5y agoAh that’s interesting. I’ll have to actually give that a try at some point. I think the API gateway model makes more sense in my head.