The table was live, the queries flowing, when the order came: add a new column. No delay, no downtime. The database had to evolve while production traffic kept moving.
A new column can be trivial in a tiny table and brutal in a massive one. The differences lie in how you plan schema changes. On small datasets, adding a column is often instant; on large ones, it can lock writes, block reads, and cause cascading impact downstream. Schema migrations that add columns must be designed to minimize risk.
When adding a new column in SQL, know your engine. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable columns without defaults. Add a default, though, and large tables can freeze. For MySQL and MariaDB, online DDL can mitigate downtime, but the right flags and storage engine settings matter.
Index strategy matters before and after the column exists. Adding an index at the same time as the new column creation may double your migration time. Splitting the steps — create the column, backfill it gradually, then add indexes — reduces contention.