A schema changes. A database groans. You need a new column, and you need it without downtime.
Adding a new column is more than a DDL statement. It’s about control—knowing how to introduce change without breaking production. In MySQL, ALTER TABLE ADD COLUMN looks simple, but behind it is locking behavior, copy-on-write concerns, and migration strategy. In PostgreSQL, you may add a nullable column instantly, but large tables can still trigger I/O spikes. On distributed systems like CockroachDB, adding a new column touches every node, every shard.
The safest approach starts with understanding the storage engine. Is the new column nullable? Does it have a default? Defaults that aren’t constant expressions can cause data rewrites. That rewrite is your enemy—it slows everything. Adding columns with NULL defaults avoids the rewrite. Populate data in batches to distribute load.
For production, never run raw DDL in isolation. Wrap it in migration tooling. Use feature flags to guard code paths until the column is ready. For systems running at scale, watch replication lag, monitor query latency, and schedule the change during low-traffic windows.