Adding a new column seems simple until it runs on a live system. Schema changes, locking, migration speed, and data integrity can turn a one-line change into a production risk. In relational databases like PostgreSQL, MySQL, or MariaDB, the command is clear:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
That line creates the new column, but the real work begins before and after execution. On large datasets, adding a column without defaults avoids table rewrites, reducing downtime. Processing defaults in a follow-up UPDATE with batched writes prevents long locks. For mission-critical services, running ALTER TABLE with metadata-only changes — when supported — is the safest route.
In distributed systems, adding a new column impacts API layers, ORMs, and serialization formats. Forward compatibility means new producers can write to the column while old consumers ignore it until fully migrated. Backward compatibility ensures reading existing rows without errors. Always ship schema changes before code that depends on new fields.