Adding a new column in a production database sounds simple. It is not. The wrong approach can lock tables, block queries, or corrupt data. The right approach keeps the system online, avoids downtime, and preserves integrity.
Start with your schema. Decide the data type, constraints, and default value before you touch the database. Use migrations in version control so the change is traceable and reversible. On large tables, avoid a blocking ALTER TABLE in one step. Instead, create the new column as nullable, backfill in batches, then lock and enforce constraints.
For Postgres, a nullable column with no default is fast to add. Populate it in manageable transactions. Verify each batch. Only after the data is complete should you add NOT NULL or indexes. For MySQL, be aware of the storage engine. InnoDB can handle some instant column additions, but older versions require a table copy. Test every path in staging before hitting production.