Adding a new column sounds simple, but in production systems it can be costly if mishandled. Schema migrations that add columns can trigger table rewrites, block writes, or cause downtime. The goal is to add the column as quickly and safely as possible while keeping the system online.
First, check the database engine’s approach to adding columns. In PostgreSQL, adding a nullable column with a default can lock the table. Avoid that by adding the column without a default, then backfilling in small batches. In MySQL, ALTER TABLE can rebuild the table unless you use ALGORITHM=INPLACE or the newer INSTANT method. Each database has specific options to minimize impact.
Control the migration speed. Run it during low-traffic windows or throttle batch updates. Use a feature flag to hide the new column from application code until it is fully populated. This lets you deploy schema changes and application changes independently.