The setup
Blue green deployment runs two identical production environments named blue and green. At any moment only one serves live traffic. Say blue is live. You deploy the new version to the idle green environment, test it in isolation, and when it looks healthy you switch the router to send all traffic to green.
Why it helps
- The switch is near instant because it is just a routing change.
- Rollback is trivial: point traffic back at blue, which is still running the old version.
- Testing happens on a production like environment before any user sees it.
The costs
- You pay for double the infrastructure during the cutover.
- Database changes must be compatible with both versions, since both may briefly run.
The cutover is all or nothing for traffic, which is its main difference from a canary that shifts traffic gradually.
Key idea
Blue green keeps two full environments so you can switch traffic instantly and roll back by flipping the router back.