The migration froze at 92%. One table had millions of rows and the schema change was stuck. The blocker: adding a new column without downtime.
Adding a new column in production is easy in theory but hard at scale. The wrong approach locks writes, drops performance, and risks data loss. Modern databases help, but each engine has its own rules. PostgreSQL can add a nullable column fast, but adding one with a default value rewrites the table. MySQL uses ALGORITHM=INPLACE for some changes, but fallback to COPY can trigger massive locks.
The safest method starts with a deep check of the database version, table size, indexes, and replication. Measure latency before you start. In PostgreSQL, ALTER TABLE ... ADD COLUMN with no default is instant. Set defaults in a later update, in small batches. In MySQL, confirm that your alter statement can run online for your storage engine.
When adding a new column to large datasets, avoid schema change tools that hide complexity but cause surprise load. Use controlled batches. If replication lag grows, stop and resume later. Monitor both primary and replicas.