Deployment Policy to Ensure Zero Downtime — Blue Green Deployment

Farooq Khan
The Startup
Published in
3 min readFeb 9, 2019
Photo by Panaya

Today I’ll discuss how can we rollout deployment on production environment keeping in mind high availability of services and zero downtime. There are quite few techniques we can use for this purpose. Today we will discuss Blue Green Deployment or Red Black Deployment. In my opinion is a fancy word simple deployment policy.

Blue Green Deployment

The basic idea in blue green deployment is that you run the two applications side by side one with old build and other with latest build. As we have some overview that what’s blue green deployment is, now let’s have a deep dive in the process of blue green deployment.

Say we have a blue server with old running build). And want to deploy new build on production environment. Create a replica a green server () on our production servers. deploy the new build on a server and say it green server. Once the build is deployed, run a smoke or sanity test to verify that everything in working fine. Now when you are sure that everything is good with the new build (green server), let’s roll it out for the users. Now here we can use two strategies to roll out new release. One thing that is important is you should keep both the server up and running for some time to fall back to the previous release in case of any issue with the new release on green server.

  • Redirect all the users to new green server.
  • Gradually roll out the new release, i.e redirect some percentage of users to the green server to make sure that new build working fine. One verified, increase the load on green server.
Blue Green Deployment Diagram

Checklist for Blue Green Deployment

Here is the checklist for blue green deployment that you should maintain

  1. You have two server up and running (with new and old builds)
  2. run sanity tests on server with new build
  3. Route some traffic to the new server for gradual roll out.
  4. Route all the traffic to the new server (with latest build)
  5. Keep the old server for some time for rolling back in case of some issue with new production build.

Final Words

We can achieve this using managed service of AWS if we our servers are hosted on AWS, for routing we can use Route53. But if the servers are in a data center and there is no managed service, then we need to have some strategy for the deployment to of the new release. And Blue Green Deployment strategy is a good option. For routing purpose we can utilize our load balancer or any other service.

This story is published in The Startup, Medium’s largest entrepreneurship publication followed by +421,678 people.

Subscribe to receive our top stories here.

--

--

Farooq Khan
The Startup

Hey, I’m Farooq, computer geek, fun friend and prefer coffee over tea. Interested in backend and elastic related stuff. Currently working at @DeliveryHeroSE