Adding a new column to a production database sounds simple. It isn’t. Done wrong, it can lock tables, block writes, or cause downtime. Done right, it’s invisible to the user and safe at scale.
First, confirm the schema change is necessary. Review how the new column will be used, its data type, defaults, and nullability. For example, adding a column with a non‑null default value will rewrite the entire table on many databases, which is dangerous on large datasets.
Use an online schema change tool when you can. PostgreSQL, MySQL, and others have extensions or migration frameworks that apply a new column without blocking queries. In MySQL, ALTER TABLE with ALGORITHM=INPLACE avoids full table copies for certain operations. In PostgreSQL, adding a nullable column without a default is instant, but adding a default value will lock the table until the write finishes.
Always add indexes in a separate step after the new column exists and is populated. Creating an index at the same time as the column can increase lock time.