Adding a new column to a production database is a common but high-risk task. Done well, it keeps services stable and queries fast. Done poorly, it causes downtime, broken migrations, and angry alerts.
The first step is defining the new column in your schema migration. For relational databases like PostgreSQL or MySQL, use ALTER TABLE with explicit column types and defaults. Avoid locking large tables during peak load. Where possible, add nullable columns first, then backfill in small batches.
Keep schema and application changes decoupled. Deploy the new column before any code writes to it. This prevents errors when old app versions hit a database that doesn’t yet have the column, or vice versa. In distributed systems, propagate schema changes gradually to all services.
If the new column requires an index, create it after data backfill to reduce write contention. Use concurrent index builds where supported. Measure performance before and after to catch regressions early.