Adding a new column is one of the most common schema changes in relational databases. It looks simple, but it can be costly if done without planning. The size of the table, the write load, and locking behavior all matter. In production, a careless ALTER TABLE ... ADD COLUMN can lock rows or stall queries.
To add a new column without downtime, analyze your database engine’s approach. PostgreSQL can add a nullable column with a default quickly. MySQL may rebuild the table unless you use ALGORITHM=INPLACE or INSTANT in supported versions. In distributed databases, adding a new column may trigger schema propagation delays.
Plan the column type and default value carefully. Text fields with no default add fast. Columns with a default other than NULL may require rewriting existing rows. For massive tables, use an asynchronous migration pattern: