Adding a new column in a production system is simple in theory—ALTER TABLE—but in practice, it’s a test of your architecture. With large datasets, a blocking schema change can lock the table, delay writes, and degrade read performance. To do it right, you need awareness of the engine’s storage layer, transaction model, and how it handles concurrent DDL.
In PostgreSQL, adding a new column without a default value is usually instant because it only updates metadata. But if you add a default or a NOT NULL constraint, it writes to every row, which can be expensive at scale. MySQL and MariaDB historically locked the table for ALTER TABLE, but tools like pt-online-schema-change or native ALTER ONLINE in newer versions can minimize lock time. SQLite rewrites the table for most schema changes, and that fact alone can change your migration strategy.
The safest migrations follow a pattern: