Adding a new column is one of the most common schema updates. It should be fast. It should not break production. The wrong approach can lock tables, block queries, and impact uptime. The right approach makes the deployment invisible to users.
To add a new column, plan for compatibility. Backfill data where necessary. Use default values carefully—avoid heavy writes during peak hours. Test on staging databases with production-like load. Verify that your migration can run online without locking large tables.
For relational databases like PostgreSQL and MySQL, adding nullable columns is often instant. Adding columns with non-null defaults can trigger full table rewrites. Consider adding the column as nullable first, then updating rows in batches, and finally adding constraints. This avoids locking tables for long periods and keeps concurrent workflows running.
In distributed systems, schema migrations must be coordinated across services. An added column changes serialization formats, API contracts, and query patterns. Update application code only after the column exists in the database. Deploy database changes before code changes that depend on them.