Adding a new column in a database is simple in theory, but dangerous in practice. Schema changes touch running systems. Migrate too fast and you block writes. Migrate too slow and you carry dead weight. The goal is zero downtime, minimal risk, and a path to rollback.
When designing a new column, start with a clear definition: name, data type, nullability, default value. Every choice matters. A nullable column may save you from deployment errors but can cost you in query complexity. Non-null with defaults can shortcut data rewrites, but defaults live forever in your schema.
In PostgreSQL or MySQL, the ALTER TABLE statement is the standard entry point:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP NULL;
On small tables, this is done in seconds. On large, high-traffic tables, a blocking alter can freeze connections. To avoid that, use online schema change tools like gh-ost, pt-online-schema-change, or the native ALTER TABLE ... ALGORITHM=INPLACE options in modern MySQL, where supported. These tools copy the table in chunks, keep it in sync with triggers, and swap it in when ready.