The query came fast: add a new column.
You have a live system. Tables full of critical data. Queries optimized down to the millisecond. And now schema must change without breaking anything, without downtime, and without falling into a migration spiral.
A new column sounds simple. In production, it can be dangerous. The wrong type or default value can lock the table. Adding it in the wrong order can cascade into blocked writes and broken indexes. The safe approach is deliberate.
Start with a schema review. Decide if the new column is nullable or should have a default. If you set a default on large tables, add the column first as nullable, backfill in batches, then apply the not-null constraint. This pattern avoids full table rewrites.
For relational databases like PostgreSQL and MySQL, watch for metadata-only operations. These are instant. Others require rewriting the data file and can block reads. Test on a staging replica with production-like data volumes. Observe locks, replication lag, and query plans before touching production.