SaveMyCert
Cloud basics

What is blue-green deployment? A release strategy explained

Blue-green deployment is a release strategy that runs two identical production environments — one live ("blue") and one idle ("green") — deploying the new version to the idle one and switching traffic over only once it is verified, so releases are near-instant and easy to roll back. The moment traffic points at green, blue does not disappear; it stays on standby, ready to take traffic straight back if anything looks wrong. That standby copy is what makes rollback a switch rather than a scramble. This guide covers why the strategy exists, how it works step by step, its honest trade-offs, and how it compares with the related idea of canary deployment.

The problem it solves

Deploying a new version directly onto the system serving live traffic is risky in two ways: users can see errors or downtime while the update is in progress, and if something is wrong, rolling back means redeploying the previous version — which takes time and can itself go wrong. Blue-green deployment separates deploying from releasing: the new version is fully deployed and can be tested before a single real user sees it, and switching traffic to it is a fast, low-risk act rather than a fresh deployment.

How it works, step by step

The mechanics are straightforward:

  • Blue is live, currently serving all production traffic.
  • The new version is deployed to green, the idle environment — identical infrastructure, new code.
  • Green is tested in a production-like setting, without any live traffic reaching it.
  • Traffic is switched from blue to green, typically by repointing a load balancer or router — users now hit the new version.
  • Blue is kept running for a period, ready to take traffic back instantly if a problem appears in green.

The benefits

The strategy delivers near-zero downtime, since the switch itself is close to instant rather than a period of the old version being torn down while the new one starts up. Rollback is equally fast: because blue is left running rather than deleted, reverting is the same switch in reverse, not a redeployment. And because green is a full, production-like environment before it takes any traffic, testing happens under realistic conditions rather than in a separate staging environment that may drift from production over time.

The honest trade-offs

None of this is free. Running two full production environments, even briefly, roughly doubles the infrastructure in use at switchover time, which costs more than deploying in place. Database and schema changes need particular care: if both blue and green share one database, a schema change has to remain compatible with whichever version is currently live, since both may briefly need to work against it during the switch.

Blue-green in CI/CD, and versus canary deployment

Blue-green deployment is one release strategy a CI/CD pipeline can automate — our explainer on what a CI/CD pipeline is covers the build-test-deploy flow this fits into. It is worth distinguishing clearly from canary deployment, covered in its own explainer: blue-green switches all traffic from old to new in one deliberate move, while canary shifts a small percentage of traffic to the new version first and increases it gradually. The two are sometimes combined — releasing to green as a canary slice before cutting traffic over fully.

Cloud support and certification study

Load balancers and deployment services on all major clouds support blue-green patterns: AWS offers it through services such as Elastic Beanstalk, CodeDeploy and load balancer target group switching; Azure and Google Cloud provide equivalent traffic-shifting mechanisms through their own load balancing and deployment tooling. Deployment strategies including blue-green appear in the AWS Developer Associate and CloudOps Engineer Associate exams, which expect you to recognise the pattern and when it suits a release; Solutions Architect Associate expects the broader architectural picture of how such a strategy fits into a resilient system design.

Ready to start studying — free?

Original practice questions, timed mock exams and revision notes. No card, nothing to pay.

Jump straight into an exam
DVA-C02SAA-C03SOA-C03

Questions, answered

Blue-green deployment runs two identical environments, one live and one idle. The new version deploys to the idle one, and traffic switches over only once it is verified — making releases near-instant and rollback a simple switch back.

Keep reading

Cloud basics
What is canary deployment? Gradual rollouts explained
Cloud basics
What is edge computing?
Cloud basics
What is GraphQL? A query language for APIs explained
Cloud basics
What is multi-tenancy in cloud computing?