Adding a new column is one of the most common schema changes. It looks simple, but speed and safety depend on how you do it. Done wrong, it can lock tables, block writes, or trigger costly downtime. Done right, it’s seamless.
Start with a plan. Define the new column name, type, and default values. In high-traffic systems, avoid setting defaults that rewrite the entire table. Instead, add the column as nullable, then backfill in controlled batches.
Use migration tools that generate and run SQL for the new column without locking critical paths. For PostgreSQL, ALTER TABLE ... ADD COLUMN is fast if no default is set. For MySQL, newer versions optimize this, but older ones might still cause table rebuilds. Test your migration in staging against production-scale data before touching live systems.