Hacker News new | ask | show | jobs
by lflux 2025 days ago
At a previous job I was at 2007-2014, we were doing classified ads[1] we had a lot of logic in stored procedures in our Postgres database written in pl/pgsql. It made sense at the time, but after a while these got really unwieldy and deploying things got tricky, since you we needed to update both appserver code and database stored procs at the same time. There also wasn't a great way to update stored procs at the time - we built this into an RPM that just ran a postinstall script to do an atomic swap.

I wouldn't build this into the database were I to build it today.

[1] blocket.se/leboncoin.fr/segundamano.(es,mx)

1 comments

At a previous job I was at, we put each release of the sprocs into a different schema. Upgraded app servers called sprocs in schema "r102" while the not-yet-upgraded app servers continued to call sprocs in schema "r101" until they were eventually upgraded.