The migration was going fine until the schema broke. Data that had been clean now spilled into logs full of red. The problem was simple: a missing new column. The fix should have been trivial, but the database was already in production. Zero downtime was the only option.
Adding a new column in a live database is not just about running ALTER TABLE. It’s about making the change without breaking queries, APIs, or downstream systems. The right approach depends on size, indexing, and data type. You start by adding the column as nullable. This ensures the schema changes instantly, without rewriting the entire table.
For large datasets, backfilling is the danger. Migrate in small batches. Use controlled updates to avoid locks and replication lag. Monitor query plans, because new columns can change how indexes behave—even if unused at first.