A new column is more than a schema change. It impacts queries, indexes, and application logic. Done wrong, it locks tables, slows requests, and burns deploy windows. Done right, it’s instant, safe, and version-controlled.
Start by defining the new column in your database migration tool. Make it nullable and set no default at creation time to avoid table rewrites. If you need a non-null constraint or default value, backfill in small batches. This keeps locks short and prevents replication lag.
Add indexes only after the backfill finishes. Building an index on a busy table can block writes. Use concurrent index creation if your database supports it. For systems like PostgreSQL, CREATE INDEX CONCURRENTLY avoids blocking but still watch for disk I/O spikes.
Update application code to handle the new column in both read and write paths. Deploy code that can read from the old and new schemas before you enforce constraints. Then, once all services run the new code, add your constraints in a final migration.