Adding a new column to a production system is simple in theory and dangerous in practice. Schema changes can lock tables, trigger downtime, or break queries. Doing it right means treating the operation as both a code change and a data migration.
First, define the column precisely. Decide on type, nullability, and default values. Never add a column without a clear migration path for existing rows. For large datasets, consider adding the column as nullable, backfilling in small batches, then applying constraints after. This avoids full-table rewrites that can spike load.
Second, plan the deployment. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for metadata if no default is set, but slow if it needs to populate values across millions of rows. In MySQL, older versions may lock writes during the operation. Test the migration on a clone of your production database with realistic data volume before running it live.