Cloud and platform engineering

Deploy database changes with expand-and-contract migrations

Make schema changes compatible with old and new application versions during rolling deployments and rollback windows. A migration that renames or drops a field before all old application instances stop can cause production failures. Application rollback is not safe if the schema has already become incompatible. Cloud architecture decisions trade cost, resilience, operational skill and recovery time; validate them against service objectives rather than adopting a pattern by default.

Operational constraints and failure modes

A migration that renames or drops a field before all old application instances stop can cause production failures. Application rollback is not safe if the schema has already become incompatible.

  • Define service objectives and recovery targets
  • Model dependency and regional failure modes
  • Measure cost and operational overhead

Implementation approach

Add new structures in an additive phase, deploy code that tolerates both representations, backfill with checkpoints, switch reads and writes, then remove old structures in a later release after verifying all consumers.

  • Confirm the responsible owner
  • Apply the change to a representative case
  • Document decisions and exceptions

Practical example

An email column is replaced by a normalized contact table using dual-write and a verified backfill; only after all versions read the new table is the legacy column removed.

  • Reproduce the starting situation
  • Apply the described approach
  • Check the user-facing result

Verification and follow-up

Test migrations on production-shaped data, measure lock and replication impact, validate backfill completeness and exercise rollback during mixed-version operation.

  • Test expected and failure cases
  • Compare with the recorded baseline
  • Agree the next review date and owner

Questions to keep in view

When should a team use this cloud and platform engineering guide?

Make schema changes compatible with old and new application versions during rolling deployments and rollback windows.

What should be checked before rollout?

Test migrations on production-shaped data, measure lock and replication impact, validate backfill completeness and exercise rollback during mixed-version operation.