Blue/green switches all traffic from old to new at once (with quick rollback). Canary rolls out to a small % first and gradually increases, reducing risk by observing metrics before full rollout.
Advanced answer
Deep dive
Both are "progressive delivery" techniques, but the control knob is different.
Blue/green
You maintain two environments: **blue** (current) and **green** (new).
Deploy to green, run smoke tests, then switch traffic (LB/DNS) from blue → green.
Rollback is fast: switch back.
Cost: you effectively run two stacks.
Canary
You deploy the new version alongside the old and route a **small percentage** of traffic to it.
Gradually increase traffic while monitoring SLIs (error rate, latency, saturation).
Safer for unknown changes, but rollback logic and observability must be strong.
Database and backwards compatibility
Both strategies get tricky when you change schemas:
Prefer backward/forward compatible migrations.
Use feature flags and expand/contract patterns.
Common pitfalls
No automated health checks/metrics → canary/blue-green becomes guesswork.