The database schema changed overnight. You wake up to find a critical table missing a field the product now depends on. Downtime is not an option. You need a new column, and you need it without breaking production.
Adding a new column sounds simple. It isn’t. When you alter a live database, locks, migration speed, default values, and index creation all matter. The wrong approach at scale can stall writes, freeze queries, or corrupt data if code and schema get out of sync.
Start by defining the column in a way that will not trigger a full table rewrite. Use ADD COLUMN with null defaults when possible. Populate data in batches to avoid load spikes. If the column requires an index, build it concurrently to keep the system responsive.
Coordinate schema changes with application releases. Deploy the code that can handle both old and new schemas before the migration begins. Feature flags can control the switch, letting you verify data integrity before the new column becomes a hard dependency.