The database was slowing down, and the query logs told the full story. You needed a new column. Not tomorrow. Now.
Adding a new column should be simple. In production, it can be dangerous. Schema changes can lock tables, stall requests, and break features if migrations are not planned and executed with precision. A single mistake can ripple through indexes, triggers, and dependent services.
First, decide the column type. Choosing TEXT when you need VARCHAR(255) or picking INT when the range demands BIGINT will bring problems later. Keep defaults explicit. Avoid NULL unless it serves an intentional purpose.
Run migrations with safety in mind. Use ALTER TABLE in small, controlled steps. On massive datasets, online schema change tools—like gh-ost or pt-online-schema-change—can minimize locks and downtime. Always replicate changes in staging with a real subset of production data. This catches hidden constraints and performance regressions.