Adding a new column is simple in theory but ruthless in production. A wrong step can lock tables, block writes, or burn through downtime budgets. You can’t afford that. You need speed, safety, and zero surprises.
In relational databases like PostgreSQL, MySQL, and MariaDB, adding a column with ALTER TABLE can be instant—or it can rewrite the whole table. Large tables mean large rewrites, and large rewrites mean latency spikes and blocked queries. The cost depends on column type, default values, and constraints. A new column with a computed default can trigger a full table update. An unindexed nullable column, by contrast, may apply in constant time.
To add a column without downtime, you must design the schema migration in phases. First, create the column with no default and no NOT NULL constraint. Then backfill in batches, preferably ordered by primary key to avoid deadlocks. Once data is populated, apply constraints in a separate migration. This sequence keeps locks short and operations safe.