Adding a new column to a database is simple in theory, but in production it can trigger downtime, lock tables, or cause replication lag. The key is to choose the right approach based on your database engine, table size, and access patterns.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is fast for nullable columns with defaults set to NULL. But adding a column with a non-null default can rewrite the entire table. In MySQL, ALTER TABLE can cause a full table copy unless you use online DDL with ALGORITHM=INPLACE and LOCK=NONE. For very large tables, even these methods can create replication delays that stack into application errors.
Zero-downtime schema changes require planning. First, deploy the new column as nullable with no default. Second, backfill data in small batches using an idempotent script. Third, add the default and constraints only after the migration is complete. This staged process keeps queries running and avoids locking bottlenecks.