Adding a new column sounds simple. In practice, it can trigger locking, downtime, or data mismatches if done poorly. The key is to design the migration for safety and speed. Most relational databases—PostgreSQL, MySQL, SQL Server—handle ADD COLUMN differently. Some allow instant metadata updates for nullable fields. Others rewrite the table on disk. Each choice affects performance under load.
Start by defining the column type and nullability. For large datasets, default values can slow deployment because the database must update every row immediately. A faster pattern: create the new column as nullable, deploy the schema first, then backfill in small batches. This avoids long locks and keeps the app responsive.
If the column will store indexed data, add the index in a separate step. Building an index on a busy table can block writes. Many platforms now support concurrent index creation. Use these where possible to eliminate downtime.