AWS ELB: Zero downtime or Blue Green or Canary deployments!

In this post (, i talked about the Zero Downtime deployment feature inside tomcat 7 and later.

To summary this was about deploying a newer version of the same app within the same tomcat container keeping the previous WAR serving the HTTP requests until the new version is successfully deployed to take over the next users’ requests.

Today the target is the same:  avoiding to take an application off-line during an upgrade for the happiness of end users 🙂 but through one of Amazon Web Services feature: Elastic Load Balancer!

Here each application instance is deployed inside a EC2 instance alone (this usecase is not the same as the one above: we are going to deploy a complete new EC2 instance with the newer WAR and not deploying the newer WAR inside the same tomcat container)

First of all, let define some terms:

Blue Green Deployment:  Upgrading a service by adding progressively newer application version instance inside the current application pool. Both version coexists: we increase N+1 instances and decrease N instances number. (CAUTION about database upgrades. I just think about it while writing but this is suitable for NoSQL app based)

Canary Deployment:  Testing new features by adding into the service 1 newer application version instance. Suitable for UI features.

With ELB it’s very simple to achieve one of those deployment style whatever your purpose is: blue-green upgrade or feature testing one

While setting up an ELB: you have to setup the load balancing protocol part and then specify the EC2 instances that are part of your load balancing pool. You can dynamically add or remove instances for the ELB settings serving or no more serving requests to them.

During an upgrade: 

  1.  deploy your N+1 software instances
  2. migrate your schema if needed (CAUTION your database is supposed to support 2 frontends different code level)
  3. add 1 of the N+1 software based instance to the load balancer pool: it will then served requests
  4. analyze the end users feedbacks and also the application logs
  5. if everything is fine add others newer apps instances to the load balancer pool and remove the same number of old version app instances.
  6. redo this to remove all the instances for your previous app version.

You are done!

Others links


Votre commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:


Vous commentez à l’aide de votre compte Déconnexion /  Changer )

Image Twitter

Vous commentez à l’aide de votre compte Twitter. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l’aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s