What is Blue-Green Deployment?

by Sydney Stone

Blue-Green deployment is a development term for the process of launching application updates without service disruptions. It does this by using two production environments that are connected to the same database. One environment is live (green) and the other is the one being updated and tested (blue).

The Blue-Green method has become very popular among developers because it allows for continuous delivery to users and helps to mitigate financial risks caused by errors, bugs and downtime.

In this post, we’ll take a look at how Blue-Green deployment works as well as the benefits of utilizing this type of update.

The Blue-Green Deployment Model

In Blue-Green deployment, the “blue” version is the production environment in which you work on new updates, fixes and features. The “green” version is the “live” app that all of your users are currently interacting with and seeing.

In Blue-Green deployment, all traffic is routed to the green site via a load balancer until the blue site has been tested and deployed. Once the new updates are launched, the router is switched to forward all traffic to the blue site. When done correctly, users never know the difference. They only see the new added features. If you happen to experience any problems with the newly released version, you can quickly re-route users back to the old green version while you make corrections.

Even cloud-based applications are able to take advantage of Blue-Green deployment by using weighted round-robin load balancing. For example, to orchestrate blue and green deployment in Azure, Microsoft users can route traffic via the Azure Traffic Manager. Amazon offers users another way to reap the Blue-Green benefits through its Elastic Beanstalk environment.

And speaking of benefits, let’s take a look at what you can gain by going Blue-Green.

Blue-Green Deployment Benefits

The biggest advantage to the Blue-Green deployment method is that there is zero downtime. In the past (and even now), many companies will send out an email notification or post a “scheduled maintenance” notice on their site in order to inform customers of a period of time in which they won’t have access to the solution. This scheduled downtime usually takes place in the wee hours of morning while most users are sleeping.

However, today’s solutions are increasingly global with active users from many different time zones. With the Blue-Green method, no users are affected, regardless of where they are in the world and what time they are using the app. Plus, you don’t have to ask your development team to come in and work a graveyard shift in order to make the updates. Happier users and happier developers result in a win-win situation for everyone involved.

Zero downtime leads to another important benefit of Blue-Green deployment: no revenue loss. Revenue loss can occur in two ways when it comes to making updates. One, if you schedule your app to be down for a period of four hours or so, you lose any potential sales that might have happened during that time frame. We all know that time is money, right? Secondly, if you rush to get updates done as quickly as possible and launch them without proper testing, there may be a lot of bugs in the new release, which means your customers may become frustrated and could even stop using the app.

Blue-Green deployment gives you the ability to address all of these issues. No downtime means happy customers and no lost revenue. Happy customers lead to an increase in sales as well as increased brand loyalty. Pretty soon, those “scheduled maintenance” postings and emails will go the way of the dinosaur, as more and more smart development teams adopt the Blue-Green method.

Of course, there are a few Blue-Green deployment alternatives, including canary deployment, rolling deployment, and A/B testing methods. The one that is right for you will depend on your specific application and development team.

Conclusion

Every application or website needs regular maintenance and updates. As a business owner, you certainly want to make sure that your product is up-to-date, but you don’t want to risk losing customers or revenue because of downtime. The goal is to update the product without the users ever knowing it’s happening in the background. You just want them to be “wowed” with all the new features and their continuously enhanced user experience.