Senior Backend Engineer / Stage 2 · Data
Roll a schema change through two application versions
Plan an expand-and-contract migration and identify the rollback boundary.
"Already know" meets prerequisites. "Not relevant" removes the topic from your total but leaves what builds on it waiting.
Self-check
- Your old application writes `orders.status`; your new application needs `orders.fulfilment_state`. Describe expansion, compatible writes, backfill verification and contraction. Identify the point after which the old binary can no longer be restored safely.
- Evidence to include: Include a compatibility matrix for both binaries at each step, a query that detects mismatched values, and a plan to stop rather than wait indefinitely for a conflicting lock. Do not claim zero downtime just because an operation is syntactically additive.
Try it without the material first, then compare. Save your answer in your notes below. Report a problem with this self-check
Learning activities
2 activities- Not doneALTER TABLE (opens another site)
The primary reference for which lock each schema change takes, and for adding a constraint NOT VALID now and validating it later under a weaker lock. Read the notes on lock levels and ADD CONSTRAINT, not the whole page.
20 min - Not doneExpand-and-contract migrations (opens another site)
A worked example of the pattern step by step: add the new column, copy data across, switch readers, then drop the old column. The steps carry over to any ORM.
15 min