Adding a new column is one of the most common schema changes in any relational database. Done well, it’s fast, safe, and doesn’t break production. Done poorly, it can lock tables, spike CPU, and cause cascading failures.
The first step is knowing your target database. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward, but adding a column with a default value writes to every row. On large tables, that means a full table rewrite. In MySQL, defaults are cheaper if they are NULL, but adding NOT NULL columns requires a default. These details matter when uptime matters.
Zero-downtime migrations are the gold standard. You can stage the change by first adding a nullable column. Then backfill data in small batches. Finally, enforce constraints after the write load stabilizes. This sequence reduces locks and lets you roll forward without blocking reads.