Adding a new column sounds simple. In production, it’s not. Schema changes can lock tables, spike latency, or even cause downtime. The key is knowing the right approach for your database engine, workload, and traffic shape.
In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward for most cases. Adding a nullable column with no default is near-instant. But adding a column with a default value can rewrite the whole table, increasing I/O and blocking writes. The safer route is to add the column as nullable, then backfill in small batches, and finally set the default.
In MySQL, the impact depends on the storage engine and version. Newer MySQL and MariaDB versions support ALGORITHM=INSTANT for adding certain nullable columns without table-copy operations. This reduces migration time to seconds regardless of table size. Always check the execution plan before assuming instant apply.
For distributed SQL systems, column addition often triggers schema propagation to all nodes. Latency depends on consensus protocols. Here, rolling schema updates and staged rollout strategies can reduce impact.