Adding a new column sounds like a small change. It isn’t. In production systems, the wrong migration can lock tables, stall requests, or even corrupt data. Every step must be deliberate—planning the schema update, deploying migrations safely, backfilling data without pushing CPU or I/O beyond safe limits.
First, define the new column with exact types and constraints. Think about nullability from the start. Adding a NOT NULL column to a large table without a default can block writes while the database rewrites it. Use NULL with backfill, then apply the NOT NULL constraint after the data is complete.
Second, write safe migrations. In PostgreSQL, ALTER TABLE ADD COLUMN is usually fast if defaults are absent. MySQL may handle this differently depending on engine and version. Test these in a staging environment with realistic data volumes. Measure execution time and check query plans.