12.1. Deployment Patterns
Every deployment pattern is a different answer to one question: how do you replace running code without dropping requests or losing the ability to undo? Blue/green swaps all traffic at once for instant rollback at double the cost; canary shifts a trickle first to limit blast radius; rolling updates trade rollback speed for resource efficiency. This chapter covers each pattern with its rollback path and — the part everyone underestimates — the database-compatibility constraint that expand/contract migrations exist to solve.
Topics Covered
Section titled “Topics Covered”- 12.1.1. Blue/Green Deployment: Instant Cutover and Rollback: Covers blue/green deployment: running two environments for instant cutover and instant rollback.
- 12.1.2. Canary Release: Progressive Traffic Shifting: Explains canary releases that shift a small slice of traffic first to limit the blast radius of a bad deploy.
- 12.1.3. Rolling Update: Staged Update Strategy: Covers rolling updates that replace instances gradually, trading rollback speed for resource efficiency.
- 12.1.4. Feature Flags: Decoupling Deployment from Release: Explains feature flags that decouple deployment from release, letting you ship code dark and enable it later.
- 12.1.5. A/B Testing: Experimentation via Traffic Splitting: Covers A/B testing via infrastructure-level traffic splitting and its statistical pitfalls.
- 12.1.6. Shadow Deployment: Cloning Production Traffic: Explains shadow deployment, cloning production traffic to a new version without affecting users.
- 12.1.7. Zero-Downtime Database Migrations: The Expand/Contract Pattern: Covers the expand/contract pattern and the N-1 compatibility rule for zero-downtime schema migrations.