Ask HN: Why is building apps around stored procs frowned on? I'm loving it
I’ve written much of the back end logic in Postgres stored functions and it feels awesome. Instead of writing database logic in typescript I just do a very simple sql query to call the stored procedure……. it’s much easier.
And ChatGPT seems extremely good at writing stored functions, so much of the development is conversing with AI to add features to the stored functions.
So this has felt awesome and I’ve been more productive than ever before. There’s almost no logic in the web application, just very simple queries that receive JSON from Postgres so I don’t even have to do any faffing around to convert rows into arrays/objects.
And it the same time I can almost hear all the industry experts yelling at me about what a bad idea it is to put your business logic in stored functions.
But why? What’s the big problem? I don’t get it. I feel like I’ve discovered some secret superpower that everyone says is kryptonite.
The stored functions are version controlled by my jetbrains IDE, so it can’t be that. So what is it that’s so bad about stored functions?