Adding a new column to a production database sounds simple until you do it under load. Schema changes can lock tables, block writes, and cause cascading failures if not handled with care. Whether you work with PostgreSQL, MySQL, or cloud-managed databases, speed and safety depend on the right approach.
Plan the change. First, define the new column with a clear, explicit type and default. Avoid implicit type conversions that can rewrite the whole table. If you can, separate the creation of the column from the backfill of data. This reduces the lock time and keeps transactions small.
For PostgreSQL, use ADD COLUMN with a default only if you know the table is small. On large tables, create the new column without a default, then update rows in batches. For MySQL, be aware of storage engines—InnoDB handles many ALTER TABLE operations with an in-place algorithm, but not all types of changes qualify.
Test the migration on a staging copy of production data. Benchmark the time each step takes, and watch for replication lag if you have read replicas. Monitor queries that might fail because they expect the column to exist.