Adding a new column sounds simple. The wrong plan can lock rows, slow queries, or stop production. The right plan adds data without risk and stays clean for the future.
In SQL, a new column can be appended with an ALTER TABLE statement. For example:
ALTER TABLE orders
ADD COLUMN shipped_at TIMESTAMP NULL;
This creates a nullable column in-place. On small tables, it is instant. On large tables, the operation can rewrite the whole file. That is where downtime creeps in.
Modern databases like PostgreSQL and MySQL offer optimizations. Adding a column with a DEFAULT and NOT NULL forces a table rewrite. Adding it nullable avoids that rewrite and speeds deployment. If you need a default, use a two-step approach: add the column as nullable, backfill data in batches, then set NOT NULL and defaults afterward.