Cloud & Software Development

Blue-green deployment

Also known as: blue/green deployment, red-black deployment, blue-green release

Blue-green deployment keeps two identical production environments, 'blue' and 'green.' One serves users while the new version is installed and tested on the other; then traffic switches over in one step.

If something breaks, you switch back. While it offers some of the fastest rollbacks available, it doubles infrastructure during releases and does nothing to protect you from a bad database change.

Blue-green deployment, explained at three levels

At home

Think of a restaurant with two identical kitchens. One serves tonight's dinner while the other is set up with a new menu. When the new kitchen is ready, waiters start sending orders there instead. If the new dishes go wrong, they simply send orders back to the old kitchen, which never stopped working. Blue-green deployment does the same with two copies of a software system.

At work

Blue-green deployment keeps two identical production environments. One, say blue, serves customers while the new version is installed and tested on green. When green is ready, all traffic switches over at once. If problems appear, traffic switches back to blue in seconds. Businesses care because updates cause little or no downtime and rollbacks are nearly instant, at the cost of running duplicate infrastructure.

Real-world examples

At home

Thomas ran a small online store and dreaded updates that took his site down. His hosting provider offered blue-green deployments, so now he tests each update on the idle copy and switches over during his lunch break.

At work

Carlos is a release manager at a Quebec government services portal. With blue-green deployment, his team switched to a new version at 6 a.m., found a login bug at 6:05, and switched back by 6:06, before most citizens noticed.

How it compares

featureBlue-green deploymentRolling deployment
Switch styleAll traffic at onceServers updated one batch at a time
Rollback speedSecondsSlower, reverse the roll
Extra capacityA full second environmentLittle or none
Mixed versionsNo, one version at a timeYes, during the rollout

Blue-green buys instant rollback with extra infrastructure.

For analysts

Blue-green is easy to approve and hard to do well when data is involved. I'd ask the team to explain how a rollback works if the database has changed, because that answer tells you whether the safety net is real.

History & origin

The technique came out of work at ThoughtWorks in the mid-2000s and was popularized by Jez Humble and David Farley's 2010 book Continuous Delivery and a Martin Fowler article that same year. Cloud computing made it practical for more teams, because spinning up a second environment no longer meant buying a second set of servers. Cloud services such as AWS Elastic Beanstalk and CodeDeploy built blue-green switching into their tooling. In my view, blue-green is the most intuitive release strategy to explain to non-technical stakeholders: there's an old house and a new house, and you just move the front door.