Adding a new column should be simple. In practice, it can be a breaking point for production databases. Schema changes in live systems carry risk—downtime, locks, degraded performance. Faster release cycles make it worse. Teams need a way to add a new column without blocking queries or corrupting data.
A new column in SQL often means an ALTER TABLE operation. On small datasets, it runs instantly. On large tables, it can lock writes and stall reads. For PostgreSQL, adding a nullable column with a default can rewrite the entire table. MySQL may block for minutes or hours. The wrong migration strategy can slow or crash an entire service.
The safest approach is online schema migration. Add the new column without immediate backfill. Set it as nullable or without default, then update values in small batches. This avoids a table rewrite and finishes in the background. Once data is populated, enforce constraints and set defaults. Each step should be atomic and rollback-ready.