What Is an Expand-Contract Migration?
An expand-contract migration, also called parallel change, splits a schema change into phases that each keep old and new code working together. The expand phase adds new columns or tables without removing anything, application code is updated to use them, data is backfilled, and only then does the contract phase drop the old structures. Each phase is independently deployable and reversible.
Why it matters
Changing a schema and the code that uses it in one deploy forces a risky lockstep release. Expanding first lets old and new code coexist, so deploys and rollbacks stay safe at every step.
Related guides
What Is a Zero-Downtime Schema Change?A zero-downtime schema change alters a live database without interrupting service, using non-blocking operati…
What Is a Blue-Green Database Migration?A blue-green database migration keeps two database states in sync so traffic can cut over to the new schema a…
What Is the Plan and Apply Cycle?The plan and apply cycle is the infrastructure-as-code workflow of computing a proposed change set, reviewing…