A schema change just hit production. You need a new column, and you need it without downtime.
Adding a new column is one of the most common database migrations. It sounds simple, but at scale it can stall deployments, lock tables, and break services. The difference between a smooth rollout and a 2 a.m. incident is in how you design and execute the change.
When creating a new column in SQL, define its purpose and data type first. Avoid heavy defaults on large tables. In PostgreSQL, adding a nullable column without a default is instant. In MySQL, behavior depends on version and engine — recent MySQL and MariaDB releases optimize this, but older versions may rebuild the entire table.
For production systems, add the column first, then backfill in small batches. Use an id or timestamp range to chunk updates. This reduces lock time and keeps load predictable. Monitor replication lag if your database runs with read replicas, and never assume the migration is safe without testing it against production-like data.