Adding a new column sounds trivial. In production, it is a test of precision. Schema changes can lock tables, block writes, and trigger outages if executed without care. You need to modify structure without breaking queries or corrupting data.
The first step is knowing the type. Choose a type that matches the data exactly—no bigger, no smaller. Larger types waste memory; smaller types risk overflow. For frequently filtered columns, add indexes. For wide tables, indexes on new columns must be planned to avoid performance collapse.
Run migrations on a staging environment first. Mirror production data scale to detect slow ALTER TABLE operations. Some databases use metadata-only changes for adding a new column without a default value. Others rewrite the entire table. Read the documentation for your engine—PostgreSQL, MySQL, or any other—before you execute.
When defaults are required, consider adding the column as NULL first, then backfilling in small batches. This avoids long locks and reduces the risk of downtime. Treat backfills as code deployments: version them, monitor them, and be ready to roll back.