Adding a new column sounds simple, but in production systems it can be costly. Data size, migration time, locking behavior, and backward compatibility all matter. A blocked ALTER TABLE on a large dataset can stall writes for minutes or hours. For critical workloads, that’s a deployment risk you can’t take.
First, define what the new column must store. Choose the right data type. Avoid defaults that force rewrites of every row. Use nullable columns if possible, and backfill in controlled batches. In PostgreSQL, adding a nullable column without a default is instant. In MySQL, this can trigger a table copy unless you’re on a version with online DDL support.
Plan the rollout in stages. Add the column. Deploy the code that writes and reads it. Backfill data asynchronously. Remove feature flags only after verifying completeness. Monitor load, replication lag, and query performance during each step.