<strong>Blue-green deployment</strong> is running two identical production environments (blue and green). You deploy to the inactive one, test it, then switch traffic over. Enables zero-downtime deployments and instant rollback.
The Stage Performance Analogy
Blue-green is like having two stages. Audience watches Stage A while you rehearse the new show on Stage B. When ready, instantly switch audience to Stage B.
Stage A (Blue)
Current show
Stage B (Green)
Rehearse new show
Audience (Users)
Switch stages instantly
Serving Traffic
Deploy New Version
Instant Cutover
Blue is live
All traffic goes to blue environment
Deploy to green
Deploy new version to green (inactive)
Test green
Run smoke tests, verify everything works
Switch traffic
Load balancer routes traffic to green
Rollback if needed
Switch back to blue instantly if issues arise
Wrong
"Blue-green requires double the infrastructure cost"
Correct
<strong>Only during deployment</strong>. After switching, you can shut down the old environment or keep it for instant rollback. Cost is temporary, safety is permanent.
Deploying a critical update:
Blue environment serves 1M users
Deploy new version to green environment
Test green with internal traffic
Switch 100% traffic to green → zero downtime!
If issues: Switch back to blue in 5 seconds