Adding a new column is simple in theory, but a production system turns it into a live operation under load. The wrong move can lock tables, spike latency, or crash services. The right move keeps the system breathing while extending its capabilities.
In SQL, ALTER TABLE is the foundation.
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
On small datasets, it runs fast. On large ones, this can be dangerous. Engine behavior varies—PostgreSQL, MySQL, and SQL Server handle schema changes differently. Some require table rewrites, others support metadata-only operations. Understand the engine before you run the command.
Zero-downtime migrations are the standard for high-traffic systems. Online schema change tools like gh-ost or pt-online-schema-change create a shadow table, stream updates, and swap it in without blocking writes. Cloud databases often provide native online DDL, but you need to test in staging with production-like load.