Adding a new column sounds simple, but in production systems it can be high risk. Schema changes can lock tables, block queries, and trigger downtime if not done with care. The right approach keeps your application running while the database shifts beneath it.
First, decide the exact type and constraints for the new column. Will it be nullable or require a default value? Setting a default is safer than backfilling in one massive write. For large datasets, split the change into stages: add the column as nullable, deploy code that writes to it, then backfill in batches. Finally, make it non-nullable if needed.
On Postgres, use ALTER TABLE … ADD COLUMN with NULL allowed at first to avoid table rewrites. In MySQL, watch for how storage engines handle defaults and online DDL. Test these migrations in a staging environment with production-like size. Benchmark the impact on write and read latency.