Compare Blue-Green Deployments vs Canary Deployments vs Rolling Releases.
β Interview Prompt: Compare Deployment Strategies: Blue-Green (instant router cutover), Canary (percentage traffic splitting), and Rolling Updates (instance-by-instance replacement).
Evaluating deployment release strategies:
| Strategy | Traffic Routing Mechanism | Rollback Speed | Hardware Cost |
|---|---|---|---|
| Blue-Green | Router switches 100% traffic from Blue to Green | Instant (Switch router back) | High (200% capacity needed) |
| Canary | Route 5% traffic to new version; gradually scale to 100% | Instant (Route 100% to stable) | Low to Moderate |
| Rolling Update | Replaces old instances with new instances 1-by-1 | Slow (Rollback instances 1-by-1) | Low (100% capacity) |
Code Implementation Example
Canary Traffic Splitting Architecture:
[Ingress Router] ββ(95% Traffic)ββ> [Stable Version (v1.0)]
βββ( 5% Traffic)ββ> [Canary Version (v2.0)]Use Canary deployments to validate new software releases with a small traffic sample before full rollout.