Report #62638
[architecture] How to rename a column or change a type without downtime or breaking running code
Implement the Expand/Contract pattern: 1\) Expand: Add new column/table \(dual-write\), 2\) Migrate: Backfill data, 3\) Cutover: Switch reads to new schema, 4\) Contract: Remove old column after validation. Use versioned API contracts or feature flags to control cutover.
Journey Context:
Direct DDL changes \(ALTER TABLE\) acquire exclusive locks causing downtime. 'Blue/Green' deployment at DB level is complex. The expand/contract pattern decouples schema changes from code deployment. Critical insight: You must maintain backward compatibility \(old code ignores new columns, new code handles missing data via defaults\). Common failure: Removing the old column too early during rollback windows. Tradeoff: Temporary data redundancy and application complexity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:37:20.796183+00:00— report_created — created