n00b
n00b

Reputation: 6360

Blue Green Deployments vs Rolling Deployments?

What's the difference between a blue/green deployment and a rolling deployment? I always thought that a blue/green deployment was a sudden switch of traffic from the old version to the new version immediately.

This talk about Blue/Green deployment on AWS shows various different strategies to implement a blue/green deployment, but they also seem to match the definition of a rolling deployment.

Is a blue/green deployment a subset of rolling deployments?

Upvotes: 57

Views: 36184

Answers (4)

Ilya Peterov
Ilya Peterov

Reputation: 2065

Another niche use-case that we had to consider when choosing between them is the load-balancer behavior.

If we use a standard round-robin balancer, during deployment the same user will probably jump between old and new instances of the application, which may or may not be a problem.

In our case, we had to reload the page each time to fetch the corresponding frontend version, which didn't feel nice. This, in turn, forced us to enable stickiness in the balancer (the user is served by the same instance as long as it's available). But stickiness introduced uneven load, where some instances were completely overloaded and others were idle.

So, we had to switch to blue-green deployment to make sure that there is no back-and-forth version switching during the deployment.

Upvotes: 1

Blue-Green Deployment:

There are two environments, Blue environment which is "old" and contains one or more applications(instances or containers) and Green environment which is "new" and contains one or more applications(instances or containers).

Then, 100% traffic is quickly switched from Blue environment to Green environment at once as shown below:

enter image description here This image above is from https://www.encora.com/insights/zero-downtime-deployment-techniques-blue-green-deployments originally created by the company "Encora"

enter image description here This image above is from https://avikdas.com/2020/06/30/scalability-concepts-zero-downtime-deployments.html originally created by Avik Das

In addition, there is Canary Deployment which is gradual way of Blue-Green Deployment. In this case of Canary Deployment, 100% traffic is gradually switched from Blue environment to Green environment taking a longer time(30 minutes, hours, or days) than Blue-Green Deployment as shown below:

enter image description here This image above is from https://www.encora.com/insights/zero-downtime-deployment-techniques-canary-deployments originally created by the company "Encora"

Rolling Deployment:

There is one environment which contains one or more "old" applications(instances or containers).

Then, one by one, one or more "old" applications(instances or containers) are replaced with one or more "new" applications(instances or containers) as shown below:

enter image description here This image above is from https://avikdas.com/2020/06/30/scalability-concepts-zero-downtime-deployments.html originally created by Avik Das

Upvotes: 20

itaysk
itaysk

Reputation: 6254

I have written an essay on this topic here: http://blog.itaysk.com/2017/11/20/deployment-strategies-defined

In my opinion the difference is whether the new version is applied by replacing instances in the existing setup (in the case of rolling upgrade), or a completely isolated setup is created for the new version (in the case of Blue/Green). In my opinion Blue/Green is the safest strategy and is better in most cases for production deployments. Read the post for a detailed comparison.

Upvotes: 54

Sarat Chandra
Sarat Chandra

Reputation: 6140

In Blue Green Deployment, you have TWO complete environments.

One is Blue environment which is running and the Green environment to which you want to upgrade. Once you swap the environment from blue to green, the traffic is directed to your new green environment. You can delete or save your old blue environment for backup until the green environment is stable.

In Rolling Deployment, you have only ONE complete environment.

Once you start upgrading your environment. The code is deployed in the subset of instances of the same environment and moves to another subset after completion.

So both are different in various factors and you need to choose the deployment model based on the scenario. Blue/green deployment is not a subset of rolling deployments.

Upvotes: 50

Related Questions