4 ms·
Yup. Postgres cannot send confirmation mails, push notifications, make calls to Stripe or anything really. I cannot think of a situation where an API only hand
by berkes 6y ago
Yup. Postgres cannot send confirmation mails, push notifications, make calls to Stripe or anything really.
I cannot think of a situation where an API only handles CRUD data and lacks any behaviour.
But, If your API really only is pushing data around, ' such tooling is usefull and probably saves a lot of time.
- berkes 6y agoAs awb points out: you now have a splintered codebase. I'd add that you also have hard to spec couplings and difficult to manage microservices setup. Tools like MQTT or paradigms like eventsourcing might help. But those all presume your database is a datastore. And not the heart of your businesslogic.
- michelpp 6y ago> Yup. Postgres cannot send confirmation mails, push notifications, make calls to Stripe or anything really. You put an item in table queue using SELECT FOR UPDATE ... SKIP LOCKED and some out of band consumer sends your email. PostgREST isn't about doing everything in the database it's about doing all the same patterns you already do but with less boilerplate.
- mixmastamyk 6y agoInteresting, so how does that fit into the model definition/admin? How to do migrations for example? Have to do it all in sql, I’m guessing. May not be a win in the long run.
- rapind 6y agohttps://sqitch.org/ https://sqitch.org/ Is a popular migration tool or you can use whatever your used to from your framework of choice (Rails or what have you)
- how_gauche 6y agoYou can also use NOTIFY in your postgrest stored procedure to wake up a hypothetical backend processor with low latency. I really love this project! I recommend it to people all the time.
- qaq 6y agoIt sure can, should you do it though is a dif. question. You can use PL/Python that ships with PG.