Adding a new column sounds simple, but in production systems it can break deploys, lock tables, and trigger downtime. At scale, even a single ALTER TABLE can cause a performance hit that ripples across services. Choosing the right approach depends on your database engine, your schema design, and your tolerance for locking and replication lag.
In PostgreSQL, ADD COLUMN with a default value used to rewrite entire tables. Newer versions skip the rewrite for NULL defaults, but careful planning is still required. With MySQL, adding a column can block writes unless you use ALGORITHM=INPLACE or INSTANT where available. For distributed SQL systems, schema changes must be coordinated across all nodes to avoid version skew.
Best practice: add the new column without defaults, backfill in small, controlled batches, and then set the default or constraint in a separate migration. This reduces downtime and keeps locks short. Always pair schema migrations with application code changes that are forward- and backward-compatible. Deploy the code first, handle the migration in the background, then flip the feature switch.