Adding a new column to a production database seems small. It can change everything. Done wrong, it locks tables, blocks writes, and triggers downtime you cannot afford. Done right, it unfolds like a single, fast transaction with no risk and no disruption.
Every engineer knows the tension. Schema evolution is easy in development but punishes mistakes in production. A new column might need a default value. It might need to be non-null. It might need an index. Every choice affects memory, disk, and query performance.
The first step is knowing your database’s alter table behavior. PostgreSQL can add a nullable column instantly. Add a default, and it rewrites the table. MySQL behaves differently depending on the storage engine and version. These details are not trivia. They determine whether your migration takes seconds or hours.