Quick Notes117 words
Deployments including database tasks — quick notes
Database deployments — quick notes
| Principle | Detail |
|---|---|
| Core rule | Schema must be compatible with old and new app versions during rollout |
| Breaking change pattern | Expand → Migrate → Contract |
| Expand | Add new column; old code unaffected |
| Migrate | Dual-write, backfill |
| Contract | Drop old column only when nothing reads it |
| Migrations must be | Idempotent, transactional where possible, backed up first |
| Ordering | Migration stage before app stage; completion ≠ readiness |
Traps
- A single rename is neither independently deployable nor reversible.
on: failurecannot undo destructive DDL — only a tested restore can.