Adding a new column should be simple. In production systems, it rarely is. Schema changes touch critical paths, alter query performance, or trigger downtime if handled poorly. Understanding the exact mechanics is the difference between seamless migrations and lengthy outages.
A new column in SQL alters the table definition. The exact impact depends on the database engine, data size, and default values. In PostgreSQL, adding a column with a default that is not NULL forces a table rewrite. In MySQL, some column additions are instant, while others lock the table. In columnar stores like ClickHouse, the operation can be faster but may still impact active queries.
Best practice is to stage column changes. First, add the new column as nullable with no default. Then backfill data in batches, ensuring minimal load on the database. Only after backfilling should you set constraints or defaults. This phased approach reduces locking, replication lag, and CPU spikes.