Blue-Green Deployments: What They Are and How to Use Them

Traditional Situation

In a more “traditional” situation, we have a single production environment for our application. Even if we have a server cluster running multiple instances of our application, they run the same version. When we want to update the application, we deploy the new version in one go.

Blue-Green Deployments

First, let’s take a look at what blue-green deployments are. Then we’ll see why they’re such an interesting technique for deploying software.

Blue-Green Deployments Explained

To implement blue-green deployments, we need two identical environments to deploy our application to. We can use a single server with two instances of our application, or two separate servers. The important bit is that we deploy our application twice and run it on systems that are as identical as possible.

Advantages of Blue-Green Deployments

Blue-green deployments have two significant advantages.

No Downtime

Because we just flip a switch (in the router component), there is no downtime. We can take all the time we want to get the staging environment ready and then just route all requests to the updated application.

Rolling Back Is Easy

When a bug actually slips through our tests and makes it to production, we can quickly flip the switch in our router and send all requests back to the previous version of our application.


There are some things to keep in mind though.

Identical Environments

Why is it so important to have identical environments?

Changes to Downstream Services

How should we tackle breaking changes in downstream services?

Plan Your Deployments

The blue-green deployment technique is a simple idea in theory but not always in practice. Once you have your infrastructure set up, you’ll have to keep track of which environment is the production environment and which is the staging environment.

Why Blue and Green?

As a fun aside, here’s the story about where the colors came from. When Dan North and Jez Humble first implemented their idea, they didn’t want to choose letters because A and B can be seen as hierarchical (i.e., A is more important than B). So they went for colors and avoided using red because that is traditionally seen as a “bad” color.

Blue-Green Deployments, Not Nearly Used Enough

The idea of blue-green deployments has been around for more than a decade, but you won’t encounter it very often. It seems it hasn’t gained a lot of popularity in enterprises, even though it’s a powerful way of ensuring that quality software is released to the customer and that stress levels in the team remain low.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store



Learn how to improve the speed, quality, and visibility of your software delivery.