Adding a new column is never about decoration. It’s about enabling the schema to handle real requirements: tracking events, storing metrics, or supporting features that evolve faster than planned. When the model changes, the database must follow without breaking production.
The most direct path is an ALTER TABLE statement. In PostgreSQL:
ALTER TABLE users ADD COLUMN last_login TIMESTAMPTZ;
This works in seconds for small datasets. In large systems, the stakes rise. An unindexed column can slow queries. A nullable column may break assumptions in the code. A default value can cause a full table rewrite. Each choice impacts runtime and deploy windows.
For zero-downtime changes, pair schema migration with feature flags. Deploy the new column behind a guard. Write to it and read from it only when tested in staging. In MySQL or PostgreSQL, you can add columns concurrently using tools like pg_online_schema_change or gh-ost. These cut migration risks while keeping services live.