Adding a new column to a production database is simple in theory and dangerous in practice. One wrong move and you lock tables or drop performance. In fast-moving systems, downtime is not an option.
The safest way to add a new column starts with clarity on type, constraints, and default values. Avoid defaults that trigger a full table rewrite on large datasets. If you must backfill, do it in batches. Use nullable columns when possible, then migrate real data in controlled steps.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for empty defaults but can be costly if you force a rewrite. In MySQL, even a metadata-only change can become a blocking operation depending on table format and version. Test on a replica before touching the primary.
Schema changes should be part of a repeatable migration process. Use version control for SQL files. Deploy incrementally. Monitor locks and query performance during rollout. Combine ALTER TABLE with feature flags to control the point when application logic depends on the new column.