The database waited for a new column. You wrote the migration. You hit deploy. Everything stopped.
Adding a new column sounds simple. In production, it can break reads, block writes, and lock tables for minutes—or hours. The right approach depends on data size, schema structure, and whether zero downtime is a requirement. Done wrong, a schema change can cost real money.
A new column alters the table definition. In most relational databases, this triggers a rewrite or metadata change. In small tables, the operation is instant. In large tables, it can cascade into locks that stall incoming queries. Online schema change tools like pt-online-schema-change or native features like PostgreSQL's ALTER TABLE ... ADD COLUMN with defaults deferred can avoid downtime, but each has trade-offs.
If you add a column with a default value, some databases rewrite the full table. This is expensive on terabytes of data. Instead, add the column as nullable, update in batches, and then set the default in a later step. This sequence reduces locking and keeps availability high.