Adding a new column should be simple. In practice, it can break builds, corrupt data, and cause downtime. The right process turns it from a risk into a clean, reversible step in schema evolution.
When you add a new column to a production database, the first rule is safety. Define the column with the correct type and constraints, but keep it nullable on creation. This prevents locks on large tables and avoids blocking writes. Backfill data in controlled batches. Monitor performance and error rates throughout.
Once the column is populated, tighten it. Add NOT NULL or unique constraints after you know the data is correct. Update application code to read from and write to the new column only after it is live and stable. Use feature flags to switch over gradually.
For large tables, avoid schema changes that require full table rewrites during peak traffic. Some databases support adding a new column without a table lock, but others require downtime. Test the migration on a staging environment with realistic data volume. Time the operation to measure real-world impact.