Adding a new column in a production database is simple if you plan it, dangerous if you improvise. The wrong approach locks tables, blocks writes, and burns your SLA. The right approach keeps the app online while the schema evolves under load.
First, understand your database engine. PostgreSQL, MySQL, and modern distributed databases handle schema changes differently. In PostgreSQL, adding a nullable column without a default is fast — it does not rewrite the table. Adding a column with a default value triggers a full rewrite unless you use DEFAULT with NULL and backfill later. MySQL can use ALGORITHM=INPLACE for certain changes, but you must confirm it with SHOW WARNINGS after running ALTER TABLE in dry run mode.
Second, control the migration. Run it in staged steps: