The tables were clean, the indexes rebuilt, but one thing remained: adding a new column without breaking the system.
A new column sounds simple. It isn’t. In production databases, it can lock tables, spike latency, or cause downtime. Schema changes must be managed with precision. The risks increase with high-traffic apps. Even small changes can cause query planners to slow, caches to invalidate, or background jobs to fail.
When adding a new column, define your requirements first. Decide on type, nullability, and default values. Skip defaults if possible in the initial migration; apply them later in a separate statement. On large datasets, this approach avoids full table rewrites.
Use database-native online DDL tools when available. PostgreSQL supports adding nullable columns instantly. MySQL with InnoDB behaves differently—under the hood it may copy the table unless you run it with the right algorithm flag. In distributed SQL systems, every shard and replica must synchronize, so coordinate the deployment.