Adding a new column looks simple. It isn’t. The smallest schema change can break queries, slow writes, or trigger full-table locks. In production, one careless migration can halt traffic. The right approach depends on your database, scale, and uptime requirements.
Define the purpose first. Every new column must have a clear role. Avoid nullable sprawl. Name it with precision. Decide on type: integer, boolean, timestamp, varchar. Consider defaults to prevent null chaos.
Plan the schema migration. For relational databases, use ALTER TABLE with minimal blocking. In Postgres, adding a column with a default in one step rewrites the table—slow and risky for large datasets. Instead, add it without the default, then backfill in controlled batches. In MySQL, check if the operation is metadata-only to avoid downtime.