3 ms·
One headache I had in the past was with a highly-available app with stored procs. It was rare to do parallel app server restarts, they were instead done in seri
by erichurkman 13y ago
One headache I had in the past was with a highly-available app with stored procs. It was rare to do parallel app server restarts, they were instead done in serial. (This did make certain migrations a pain.) Outdated app servers would continue calling pgpgsql functions in the outdated way until they received new code.
We solved it with a small wrapper around the calls to plpgsql functions — we set up a build process to generate unique names that were called by version. During deploy, we'd have two or more versions of the 'same' function running in parallel. The last deploy step dropped the now-outdated functions.
It worked relatively well.
- jeltz 13y agoHave you thought about using schemas and the search path for this? That is what Zalando does to deploy stored procedures without risking any downtime.
- erichurkman 13y agoIf I had to do that again, I would. It's been a while, but as I recall from that project the database adapter had shoddy support for search paths.