Adding a new column in production is rarely as simple as it looks in code. Depending on your database, size, and workload, the operation can be instant or it can block writes, break migrations, or lock tables for hours. The right approach starts with knowing exactly what “new column” means under the hood.
In PostgreSQL, ALTER TABLE ADD COLUMN is usually quick if you add it without a default value or a NOT NULL constraint. When you set a default or force NOT NULL, PostgreSQL rewrites the entire table, which can make the change slow and disruptive. Use a NULL column with no default first, then backfill data in smaller batches, and only then set constraints.
MySQL and MariaDB can handle some ADD COLUMN operations instantly in recent versions with ALGORITHM=INSTANT, but not all changes qualify. For older tables or non-instant paths, the server may rebuild the table. Monitor the migration and test on production-like data before running it live.