Adding a new column is one of the most common database operations. Done wrong, it can lock tables, stall requests, and break production workflows. Done right, it’s invisible, instant, and safe.
The process starts with understanding the database engine. In PostgreSQL, a new column with a default value may cause a full table rewrite, making large datasets freeze under load. MySQL can avoid this with ALTER TABLE using ALGORITHM=INPLACE—but only if the column definition allows it. SQLite’s simplicity hides its own trade-offs: adding a column is fast, but constraints and indexes come later.
Plan before execution. Decide if the column allows nulls, if it needs a default, and how indexes will interact. Backward compatibility matters—existing queries and services should continue without error. In distributed systems, schema changes must be orchestrated across replicas to avoid version drift.