Remix.run Logo
simonw 5 hours ago

My hunch is that the problems with stored procedures actually come down to version control, change management and automated tests.

If you don't have a good way to keep stored procedures in version control, test them and have them applied consistently across different environments (dev, staging, production) you quickly find yourself in a situation where only the high priests of the database know how anything works, and making changes is painful.

Once you have that stuff in git, with the ability to run automated tests and robust scripting to apply changes to all of your environments (I still think Django's migration system is the gold standard for this, though I've not seen that specifically used with stored procedures myself) their drawbacks are a lot less notable.

tete 5 hours ago | parent [-]

> My hunch is that the problems with stored procedures actually come down to > version control

Git? (and migrations)

> change management

Again. Just like any other code.

> and automated tests.

Just write an automated test like you write any other kind of test?

simonw 4 hours ago | parent | next [-]

That's exactly what I'm saying. If you do those things stored procedures stop sucking.

ChromaticPanic 4 hours ago | parent | prev [-]

It's also about separately scaling your business logic from the data layer