Adding a new column is one of the most common database schema changes, yet it can be one of the most disruptive if done without care. The act looks simple: run an ALTER TABLE statement, define the column name, set the data type, choose defaults. But in high-traffic systems, the cost of locking the table or triggering a full rewrite can bring entire services to a halt.
Good design starts before the command runs. Decide if the new column will allow nulls. Decide on the default value. Decide on the minimal data type. Adding a NOT NULL column with no default will fail on existing rows. Larger data types cascade into more storage usage, longer index rebuilds, and slower queries.
For relational databases like PostgreSQL and MySQL, online schema changes or tools like pg_repack, gh-ost, and pt-online-schema-change allow you to add a column without blocking writes. In PostgreSQL, adding a nullable column with no default is near-instant, because it simply updates metadata. Adding a default or NOT NULL constraint may trigger a rewrite of the table. In MySQL, both storage engines and version affect how the ALTER executes; ALGORITHM=INPLACE can avoid a copy step.