Blue-Green Deployment

Background

edit

Blue-green deployment is one of the techniques used in continuous delivery, which is a software engineering method to release a usable software in a fast speed, as well as continuous integration[1].

Definition

edit

Blue-green deployment is a release strategy that can be utilized by developers for deploying software in a production environment. Blue can be one particular production environment whereas green can define an identical production environment. Under blue-green deployment strategy, software developers are able to minimize downtime and reduce risk[2] . The following diagram displays Blue Green Deployment in a software deployment scenario.

 

From a technical perspective, Blue-green deployment can be viewed as a process where two sets of machines alternate traffic between each other.[3].

Principle

edit

1. Two environments need to be identical so that a development team can easily switch between both environments. Either or environment can function as a backup while the other environment is live[4].

2. If the green environment has not been deployed, one should make sure to test the complete green environment in its entirety. This will ensure fully functionality when the green environment replaces the blue environment in production

Implementation

edit

As defined, the implementation of blue-green environment therefore is concerned with Amazon Web Services, IIS, Tomcat and Cloud foundry.

AWS: (Amazon Web Services) In a traditional environment, since two versions of the same software often run in the same server, the environment should always be prepared for switching from two version. Therefore developers should be extra cautious when they update their production environment as it may cause problem when reverting the server between two version. Another advantage to this approach is you now have a really easy rollback, as the other folder contains the previous version of your website.[5]

IIS: (Internet Information Services)

1.Queries IIS on the remote server to find out what the “active” home directory is (maybe the “Green” folder). 2.Unzips the package file into the inactive folder (“Blue”). 3.Changes the IIS home directory on the website to point to the updated slice (“Blue”).[6]

Tomcat Server: Tomcat Server is primarily a Java based server. The Tomcat environment involves shutting down the services, uninstalling old versions of Tomcat and re-installing newer versions of Tomcat. Parallel development is the term used to describe the blue-green deployment. [7]

Cloud foundry: For cloud foundry the following illustrates a perfect example: Step 1: Push an App Step 2: Update App and Push Step 3: Map Original Route to Green Step 4: Unmap Route to Blue Step 5: Remove Temporary Route to Green[8]

Benefits and Challenge

edit

Benefits:

1. Minimizes downtime by switching between blue and green environments.

2. Provides developers a fast way to rollback, if one of the environments becomes corrupted or fails in production.

3. Allows developer to test disaster-recovery. This allows the developer to accommodate a situation where there is a so-called "disaster" occurs.

Challenge:

Adhering to the blue-green deployment methodology in a database migration is one of the biggest issues: Often times a new release of software may involve changes in the schema of the database. Two separate databases, one serving as the other’s duplicate database is the underlying out-liar in database migration. To implement blue-green deployment, changes have to be performed in a way that maintain existing behavioral and informational semantics within the database. It is important that all the deployment and test process for the database creation is performed before deploying the new software. This helps maintain consistency of the database and ensure a backup is supported through blue-green deployment.

edit

Also see:

Continuous Delivery

Blue-green deployment in Octopus Deploy

Simple 0-Downtime Blue Green Deployments

References

edit
  1. ^ A Guide To Blue-Green Deployments & Going Live Every Day, https://www.madetech.com/blog/a-guide-to-blue-green-deployments-and-going-live-every-day
  2. ^ "Pivotal Documentation v1.5.0.0", http://docs.pivotal.io/pivotalcf/devguide/deploy-apps/blue-green.html Retrieved Sept 5, 2015
  3. ^ The DOs and DON'Ts of Blue/Green Deployment, http://cloudnative.io/blog/2015/02/the-dos-and-donts-of-bluegreen-deployment, Retrieved Sept 15, 2015/
  4. ^ Introduction to Blue green deployment by Martin Fowler, http://martinfowler.com/bliki/BlueGreenDeployment.html
  5. ^ Introduction to Blue/Green Deployment on AWS, https://medium.com/aws-activate-startup-blog/upgrades-without-tears-part-1-introduction-to-blue-green-deployment-on-aws-e5bcf90eb60b
  6. ^ Blue-Green deployment to IIS with Powershell, http://davidduffett.net/post/4833657659/blue-green-deployment-to-iis-with-powershe
  7. ^ Tomcat 7+ Parallel Deployment, http://bytearrays.com/tomcat-7-parallel-deployment/
  8. ^ Blue-Green Deployment with Cloud Foundry Example , http://docs.pivotal.io/pivotalcf/devguide/deploy-apps/blue-green.html