Adding a new column should be simple. In practice, it is where schema design, migration strategy, and production safety meet. Done poorly, it causes downtime and data loss. Done well, it becomes invisible.
First, define the new column in your schema. Keep the type explicit and defaults clear. Avoid implicit nulls unless the logic demands it. For high-load systems, use non-blocking operations. In PostgreSQL, add columns with ALTER TABLE ... ADD COLUMN and use default values cautiously, as they can lock rows or rewrite large tables.
Second, plan the migration path. For critical systems, deploy the schema change before writing to it. This means the application code can run against both the old schema and the one with the new column. Backfill values in batches to prevent locking and CPU spikes. Monitor query performance in real-time during this process.