Renaming one column broke your old servers mid-deploy
transcript
You rename one column. Name becomes full name. Mid-deploy, your old servers start throwing errors.
Here's what gets forgotten. During any deployment, old and new code both run. Halfway through a rolling deploy, half the traffic is on each version.
The migration renames the column first. The new code asks for full name. It works. The old code asks for name. Gone. Error. The data survived. The two versions just disagree about the schema.
The safe way has three phases. Expand: add full name. Write both, still read the old. Migrate: backfill every empty row. Then read the new column. Contract: write only the new column. Drop the old column last. Only once no running code reads or writes it.
Read the new column before the backfill? Un-backfilled rows come back null. Do it in order, and old and new code both work at every step.
Code rolls back in seconds. A migration can't just be rolled back. So expand, migrate, contract. Both versions always work.
Full breakdown in the lecture.