pull down to refresh
50 sats \ 3 replies \ @optimism 12h \ on: Make massive DB migrations fast II: batch, unlogged tables, defer constraints devs
It may be that I haven't drank enough coffee yet so apologies if I'm being dumb but I wonder: what magic do you possess to realize both online batch migration and zero downtime?
reply
Ah! Okay, yeah. In the past (90s, lol) I've done, once:
- Batch without constraints & test
- Double inserts into old and new (slows live down a bit but doesn't have to be a big deal)
- Batch with constraints for whatever gap is left
- Switchover with grace
- Disable double inserts
But tbh the double inserts thing was a lot of effort for not having a 10 minute or so downtime gap - this was on a callcenter like 911, so we thought it was worth it - but if I'd ever be asked again I'd stress the question: "are you sure you can't have downtime"?