Blue-green deployment is a release method that keeps two production environments, called blue and green. One serves live traffic while the other is updated and tested. When the new version is ready, traffic is switched over, typically at a load balancer or DNS level, and the old environment stays on standby.
Why it matters
The switch is fast, so users see little or no downtime, and rollback means pointing traffic back at the previous environment. It also lets you run smoke tests against the new version under production-like conditions before anyone uses it. The main costs are running double the infrastructure during the release and handling shared state, especially databases.
Example
Blue (v1) <- live traffic
Green (v2) <- deployed, tested with a test URL
Switch load balancer target: Blue -> Green
Keep Blue idle for a rollback window, then reuse it
If errors appear after the switch, point the load balancer back at Blue.
Common mistakes
- Switching traffic with DNS alone, where cached records leave some users on the old side for a long time.
- Applying a database migration that the old version cannot work with, which breaks rollback.
- Not draining existing connections or sessions at the cutover.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.