The database table was ready. The query ran fast. But the product team asked for one more field. You needed a new column.
Adding a new column seems simple. In practice, it can break deployments, cause downtime, or corrupt data if you’re not careful. The impact depends on the size of the table, the database engine, the schema change strategy, and the load on your system.
In relational databases like PostgreSQL, MySQL, or MariaDB, ALTER TABLE ADD COLUMN is the standard way to create a new column. The operation’s cost is tied to whether the new column has a default value, constraints, or indexes. Adding a nullable column without a default is usually instant. Adding a non-null column with a default forces a full table rewrite, which can lock the table and halt queries.
For mission-critical systems, online schema changes prevent downtime. Tools like pt-online-schema-change for MySQL or PostgreSQL’s ADD COLUMN ... DEFAULT improvements allow safer rollouts. Some teams implement zero-downtime migrations by first adding a nullable new column, backfilling data in smaller batches, then applying constraints in a separate migration.