{"head":{"title":"What Is Blue-Green Deployment? Definition | OceanLab","description":"Blue-green deployment runs two identical production setups and switches traffic from old to new at once. How it works, an example and the common mistakes.","canonical":"https://oceanlab.in/glossary/blue-green-deployment"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"blue-green deployment","path":"/glossary/blue-green-deployment"}],"slug":"blue-green-deployment","term":"Blue-green deployment","aka":["blue/green deployment"],"category":"Hosting and delivery","short":"A release method that runs two identical production environments and switches all traffic from the old one to the new one in one step.","body":[["Blue is the version live now. Green is the new version, deployed and tested alongside it with no user traffic. When green passes its checks, the ",{"href":"/glossary/load-balancer","text":"load balancer"}," or router sends all traffic to green. Blue stays running, so going back is one switch."],["It differs from a ",{"href":"/glossary/canary-release","text":"canary release"},", which moves traffic over gradually. Blue-green is all at once, with a fast way back."]],"why":["Releases are where most outages start. Blue-green makes a release a traffic switch rather than a change to running servers, which cuts downtime to near zero and turns rollback from a redeploy into seconds."],"example":["A booking platform deploys its new version to the green environment, runs smoke tests against it and switches traffic at a quiet hour. Error rates rise, so the team switches back to blue within a minute and investigates without users waiting."],"inBuild":["We automate the switch in the ",{"href":"/glossary/ci-cd","text":"CI/CD"}," pipeline with health checks before and after. The hard part is the database: schema changes are written to work with both versions at once, so switching back does not break."],"mistakes":[["Making database changes that the old version cannot read, which kills the rollback."],["Turning off blue straight after the switch, before the new version has proven itself."],["Forgetting background jobs and scheduled tasks, which then run in both environments."]],"related":[{"href":"/glossary/canary-release","label":"Canary release","detail":"A release method that sends a small share of users to a new version first, watches for problems, and widens the rollout step by step."},{"href":"/glossary/ci-cd","label":"CI/CD (continuous integration and delivery)","detail":"An automated pipeline that builds and tests every code change (CI) and then releases it to users in a repeatable way (CD)."},{"href":"/glossary/load-balancer","label":"Load balancer","detail":"A service that spreads incoming traffic across several servers, and stops sending traffic to any that fail their health checks."},{"href":"/glossary/feature-flag","label":"Feature flag","detail":"A switch in the code that turns a feature on or off for chosen users at runtime, without deploying new code."},{"href":"/glossary/infrastructure-as-code","label":"Infrastructure as code (IaC)","detail":"Defining servers, networks, databases and other cloud resources in code files that are versioned and applied automatically, instead of setting them up by hand."}],"tools":[],"links":[{"href":"/embedded-engineers","label":"Embedded engineers","detail":"OceanLab engineers working inside your team."},{"href":"/software","label":"Software by industry","detail":"Systems we build per industry, with guides and tools."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}