The database was fast, but the table schema was wrong. You needed a new column, and you needed it now.
Adding a new column should be simple. Yet in production systems, every second matters. The wrong migration locks writes. The wrong data type bloats storage. The wrong default value breaks downstream jobs. Precision is everything.
A new column changes the shape of your data and the paths your code takes. Before running any ALTER TABLE command, plan the migration path. In relational databases like PostgreSQL or MySQL, the cost of adding a column depends on the engine, indexes, and current load. In PostgreSQL, adding a nullable column without a default is fast because it updates the schema metadata without rewriting the entire table. Adding a column with a non-null default rewrites every row, which can stall a busy system.
For massive datasets, use online schema migration tools like pt-online-schema-change or gh-ost. These copy data to a shadow table with the new column, apply changes in small batches, and swap tables once ready. This approach prevents downtime and works even with heavy write loads.