What Is Blue-Green Deployment?
Blue-green deployment runs two identical production environments — one live ("blue") and one idle ("green") — and switches all traffic to the new version at...
Published November 18, 2026
Blue-green deployment runs two identical production environments: the live one (blue) and an idle one (green) with the new version. You switch traffic to green once it is verified, and switching back is an instant rollback.
The concept
Deploy and test the new version on the idle environment with no user impact, then flip the router or load balancer. The old environment stays ready for rollback.
Costs double the infrastructure during the switch, and database schema changes must be backward compatible with both versions.
Flip the switch
- Blue (v1) serves all traffic
- Deploy v2 to green and test it
- Router switches traffic to green
- Keep blue for instant rollback, then retire it
Practical examples
Nginx upstream switch
upstream app { server green.internal:3000; } # was blue.internalKubernetes service selector flip
kubectl patch service web -p '{"spec":{"selector":{"version":"green"}}}'Backward-compatible migration
Add new columns first, deploy, then remove old ones in a later releaseCommon mistakes
- Breaking schema changes that blue cannot read.
- Not testing green before the switch.
- Dropping blue too early.
Key takeaways
- Two environments, instant switch.
- Instant rollback.
- Database changes must be compatible.
FAQ
Blue-green vs canary?
Blue-green switches all traffic at once; canary moves it gradually.
What about sessions?
Use shared session storage so users are not logged out.