Adding a new column to a table changes the shape of your data, the performance of your queries, and sometimes the uptime of your system. In relational databases, schema changes can be fast or dangerous depending on the size of the dataset, indexes, and how your environment handles locks. Choosing the wrong approach can cause long outages or degraded API performance.
To add a new column, you start with an ALTER TABLE statement. This is simple for small tables, but for large ones it can block reads and writes. Some systems, like PostgreSQL, can add nullable columns without table rewrites. Others, like MySQL, may require a full table copy unless you use an online schema change tool such as gh-ost or pt-online-schema-change.
Consider default values and constraints. Adding a column with a non-null default often requires rewriting the table. This operation can be expensive and lock-heavy. In high-traffic systems, deploy the schema change in stages: first add the nullable column, then backfill data in batches, then add constraints or defaults later. This pattern avoids downtime and minimizes replication lag.