Top 5 Deployment Strategies

Piyush Sachdeva
3 min readApr 22, 2024

--

Introduction

In this blog post, we will discuss the top 5 deployment strategies in DevOps and compare them. This information will be helpful for those in Cloud/DevOps, Operations, Development, project delivery, or release management.

If you are a visual learner, feel free to checkout this video with detailed explanation from beginners point of view, else continue reading the blog:

Five Deployment Strategies

  1. Blue-Green Deployment
  2. Canary Release
  3. A/B Testing
  4. Rolling Update
  5. All at once/Recreate

1) Blue Green Deployment

  1. Direct traffic to the Blue environment (v1.0).
  2. Deploy v1.1 to the Green environment.
  3. Perform tests and validations on the Green environment.
  4. Update the load balancer to route traffic to the Green environment (v1.1). Now Green becomes Blue.
  5. Monitor the New environment for any issues.
  6. If everything goes smoothly, the deployment is successful.
  7. If issues arise, switch back to the other environment, the rollback process.
  8. If you are in active-active mode, you can keep the green environment or destroy it to save money.

2) Canary Release

  • Canary is a technique to reduce the risk of introducing a new software version in production by slowly rolling out the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody.
  • Like a Blue-Green Deployment, you start by deploying the new version of your software to a subset of your infrastructure to which no users are routed.
  • When you are happy with the new version, you can start routing a few selected users to it.
  • The migration phase lasts until all the users have been routed to the new version. At that point, you can decommission the old infrastructure.

3) A/B Testing

  • A/B testing is similar to the Canary release; however, you can route user traffic based on routing rules.
  • Routing rules often include Browser Version, User-agent, Geolocation, and Operating system.
  • After measuring and comparing the versions, you update the production environment with the version that yields better results

4) Rolling Update

  • In a rolling deployment, you update an instance or batch of instances simultaneously.
  • In the three-tiered web application example, UI changes will first be deployed to one instance. Once that is complete, they will be repeated on the other instance till all the instances are upgraded with the latest deployment.
  • Deployment is usually slower, but users are not impacted.

5) Recreate/All at once

  • This is often the traditional deployment strategy where the changes are deployed to all the servers simultaneously, resulting in some downtime.
  • Deployment is faster than rolling updates, but users are impacted.
  • This deployment type is usually done during a maintenance window- i.e., off-peak hours to minimize the impact.

Let's have a look at the comparison and when should we use which deployment strategy:

Conclusion

The deployment strategy should be chosen based on user requirements such as downtime, production traffic testing, conditional routing, rollback time, infra overhead, and cost. For non-production environments with no user impact, recreate/all at once has proven to be most effective due to its simple implementation.

References:

--

--