Report #47645
[architecture] Breaking schema changes causing downtime or data loss during deployment
Use the Expand-Contract pattern \(Parallel Change\): 1\) Deploy 'expand' migration adding new column/table \(backward compatible\), 2\) Deploy code that dual-writes to old and new, 3\) Run backfill job for existing data, 4\) Switch reads to new schema, 5\) Remove old column \(contract\). Each step is a separate deploy with rollback capability.
Journey Context:
Directly altering a column \(renaming, changing type, splitting\) locks tables or breaks running applications during the deployment window. Blue-green deployment doesn't help if the schema itself is incompatible. The Expand-Contract pattern treats schema changes like API versioning—maintaining backward compatibility throughout. Common pitfalls: skipping the dual-write phase \(causing data loss between deploy and backfill\), attempting to do everything in one migration, or forgetting that rollback must also be staged. This approach increases temporary storage \(duplicate columns\) and requires idempotent backfill jobs, but guarantees zero-downtime migrations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:26:51.677780+00:00— report_created — created