The build had passed. The deploy was clean. But the product owner wanted one more thing: a new column in production by the end of the day.
Adding a new column sounds simple, but in real systems it touches schema design, database migrations, and compatibility with existing code. Done wrong, it can bring downtime. Done right, it’s invisible to the user and safe for data at scale.
First, define the new column with clear requirements. Decide its type, nullability, default values, and indexing needs. A boolean flag behaves differently from a timestamp or a varchar. This decision will affect performance and storage.
Next, write the migration. In relational databases like PostgreSQL or MySQL, ALTER TABLE is the core. Avoid blocking operations on large tables during peak traffic. Use online schema change tools if your database supports them, or break the migration into smaller, non-blocking steps.