Adding a new column to a database table is one of the most common schema changes in software. It sounds simple, but done wrong, it can lock tables, block writes, or take production down. At scale, “ALTER TABLE ADD COLUMN” is not just a command—it’s an operation that can ripple through the system.
Before touching anything, define the column’s name, data type, and nullability. If the column will hold a large amount of data or will be indexed, plan for the additional storage and performance impact. Decide on a default value early; backfilling millions of rows during a deployment can turn a quick change into a costly downtime.
In relational databases like PostgreSQL, adding a nullable column without a default is usually fast, because it only updates metadata. But adding a column with a non-null default can rewrite the entire table. For MySQL, InnoDB may lock the table during certain ALTER TABLE operations unless you use ALGORITHM=INPLACE or ONLINE. NoSQL systems vary, but you often simulate a new column by updating documents or adjusting your application schema layer.