Continuous Delivery and Deployment
Scope of this domain
Continuous Delivery and Deployment tests the distinction between always-releasable software and automatic production release, plus the deployment strategies and data-migration rules that make releases uneventful.
Core rules and concepts
- Continuous Delivery: every change is production-ready and release is a business decision. Continuous Deployment: every passing change goes to production automatically.
- Pipeline stages: commit, acceptance, staging smoke, production rollout, release. Each promotion uses the same artefact.
- Strategies: rolling (gradual instance replacement), blue-green (two environments, instant switch and rollback), canary (small traffic slice validated before full exposure).
- Progressive delivery combines canary traffic shifting, feature flags and automated rollback on SLI breach.
- Database changes follow expand-contract: add new schema, dual-write, backfill, switch reads, then drop the old structure so old and new versions coexist during rollout.
- Rollback needs backward-compatible schema and retained artefacts; otherwise roll forward with a fix.
- Release gates should be automated health checks against error rate and latency, not manual sign-off.
Worked example
A team must rename a column with zero downtime. Reasoning: a direct rename breaks the old version still running during a rolling deploy. Do it in three releases: add the new column with dual writes; backfill and switch reads to the new column; drop the old column once no running version references it. Ship behind a canary at 5% traffic for 30 minutes, comparing error rate and p95 latency to the baseline with automatic rollback so regressions are caught before full exposure.
Traps that cost marks
- Treating delivery and deployment as identical.
- Big-bang cutovers with no incremental exposure.
- Rolling back a destructive migration that already dropped data.
- Feature flags with no owner or removal date, becoming permanent debt.
- A canary watched by a human on a dashboard rather than automated analysis.