Adding a new column should be fast, safe, and predictable. Yet in production systems with millions of rows, a schema change can lock tables, block writes, and stall services. The right approach depends on your database, workload, and uptime requirements.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is usually instant if the new column has no default value and is nullable. MySQL can handle ALTER TABLE ADD COLUMN without downtime using ALGORITHM=INPLACE for certain storage engines, but large datasets and active queries can still cause brief locks. In distributed systems like CockroachDB, schema changes are asynchronous, but you must account for propagation delays.
To add a new column without disruption, follow a zero-downtime migration strategy: