Adding a new column is one of the most common schema changes—and one of the easiest to get wrong at scale. A single ALTER TABLE on a large dataset can lock writes, spike CPU usage, or trigger replication lag. In high-traffic systems, even a few seconds of downtime can mean lost revenue.
Plan every change. Start by auditing the current schema. Confirm the data type, default values, and nullability of the new column. Decide whether to add indexes immediately or in a later step. Changing column structure on live production tables should be incremental.
In relational databases like PostgreSQL or MySQL, adding a new column with a constant default in one step may trigger a full table rewrite. Use database-specific strategies to avoid this overhead—PostgreSQL’s ability to add a column with a default without rewriting is available only in newer versions. In MySQL, adding a nullable column without a default is often the fastest, followed by a backfill in batches.