5 Deployment Strategies: The Pros and Cons (2024)

Octopus Deploy sponsored this post. Insight Partners is an investor in Octopus Deploy and TNS.

When you deploy applications and services to production, you want to minimize downtime and provide a seamless user experience. The days of switching off an application to perform an upgrade are long gone, and zero-downtime deployments are now table stakes for many industries.

You don’t get seamless deployments entirely without cost. Each strategy requires you to handle compatibility between versions. However, some techniques bring lots of benefits with little additional complexity.

To manage updates without maintenance windows, there are a number of deployment strategies available. Let’s look at the most common strategies to see what the trade-offs are:

  • Recreate
  • Blue/green
  • Canary
  • Rolling
  • Shadow

Recreate

The recreate strategy shuts down the running application, deploys the new version, then makes the new version available to users. This means users can’t use the application during the deployment.

Because this strategy is the simplest to implement, it’s often the application’s default deployment strategy. The only mechanism to reduce downtime on a recreate deployment is to make the deployment operation as fast as possible.

  1. Before deployment: Version 1 is running and accepting all traffic.
  2. During deployment: Version 1 has been stopped and doesn’t accept traffic while the new version is deployed.
  3. After deployment: Version 2 is running and accepting all traffic.

5 Deployment Strategies: The Pros and Cons (1)

Benefits of the Recreate Strategy

The recreate strategy for deployments is very simple. You don’t need to manage multiple versions of the application running simultaneously, and after the deployment, you can expect all users to be running the same application version.

When you use the recreate strategy, there are fewer cases where a user will interact across a version boundary. All running instances have the same application version.

There are still some cases where a user may interact across the version boundary. If they open a form in version 1 and submit it after the deployment, the request may fail if the application can’t accept the submission from the previous version. Where you have a frontend application that runs background requests, it’s possible for a user to make requests from version 1 in the frontend to your newly deployed version 2 backend.

Drawbacks of the Recreate Strategy

The main downside of the recreate strategy is the downtime. Requests made during the deployment will result in an error, as the application isn’t available. Your service-level objectives (SLOs) may account for deployment windows, in this case, a more complex strategy isn’t required as long as you can achieve the objectives without artificially limiting your deployment frequency.

The recreate strategy also means all users are exposed to problems introduced in a new application version. If a problem is detected, the previous application version must be redeployed, causing further downtime.

A progressive deployment strategy can minimize deployment-related downtime. Progressive delivery allows you to deploy an application gradually, minimizing downtime and providing simple rollbacks where needed. Let’s look at the most common options for progressive delivery.

Blue/Green Deployments

With blue/green deployments, the new version is deployed without receiving traffic. The load balancer is updated to send traffic to the new application version when the deployment is complete.

  1. Before deployment: The blue environment is running version 1 and accepting all traffic while the green environment has no version installed.
  2. During deployment (phase 1): Version 2 is deployed to the green environment while the blue environment continues to handle traffic with version 1.
  3. During deployment (phase 2): Traffic is switched from the blue environment to the green environment. The blue environment has no traffic but is running and available if a rollback to version 1 is needed.
  4. After deployment: The green environment is running version 2 and accepting all traffic, and the blue environment is phased out.

5 Deployment Strategies: The Pros and Cons (2)

Benefits of the Blue/Green Strategy

Traffic continues to flow to the application during the deployment of the new version of the application. This means the deployment has no downtime. If you detect a problem with the new application version, you can switch traffic back to the previous version just as easily.

Drawbacks of the Blue/Green Strategy

Requests between the two application versions will likely overlap more, so your application needs to be designed to handle this gracefully. If you want seamless rollbacks, compatibility in both directions must be considered.

Because two application versions run simultaneously, you need sufficient resources to run both workloads. The out-of-balance workload will not consume as much resource as the production workload, but it will still consume some. Once you’re satisfied the new version is running successfully, you can decommission the out-of-balance resources. Alternatively, you can leave them available for fast rollbacks.

Rolling Deployments

With a rolling deployment, each application instance is replaced with the new version until all instances are running the new version of the application. This allows zero-downtime deployments without the same resource requirements as blue/green deployments.

  1. Before deployment: All instances have version 1 of the application.
  2. During deployment: One at a time, each instance is stopped and replaced with an instance of the new application version.
  3. After deployment:All instances have version 2 of the application.

5 Deployment Strategies: The Pros and Cons (3)

Benefits of Rolling Deployments

Rolling deployments require fewer resources than a blue/green deployment yet still provide zero-downtime deployments.

Drawbacks of Rolling Deployments

If you discover a problem with a new version, you must redeploy the previous version to resolve it. This will take longer than a blue/green deployment, where you can just update the load balancer to send traffic to the previous version.

You also need sufficient capacity to serve requests with one instance removed, which may limit your ability to deploy during peak times. To avoid this problem, you can use a surge upgrade, which adds a new instance before each old one is removed.

With rolling deployments, both versions of the application will be run throughout the deployment process. That means you must design the application to handle both versions running simultaneously, including concerns such as both versions communicating with the same database.

Canary and A/B Test Patterns

Rather than expose all users to the new application at once, the canary strategy exposes a small number of users to the new version. You can validate the application’s stability before sending more users to the new version. You can use this approach as both a deployment and test strategy.

  1. Before deployment: All users are routed to version 1 of the application.
  2. During deployment: A small group of users are routed to the new application version. If this is successful, you can increase the proportion of users using the new version.
  3. After deployment: All users are routed to the new application version.

5 Deployment Strategies: The Pros and Cons (4)

Benefits of Canary Deployments

Canary deployments reduce deployment risk as only a sample of users is routed to the new application version. You can test application performance and functional stability based on the canary sample.

Drawbacks of Canary Deployments

Canary deployments are more complex than other strategies. You’ll need to use more advanced routing on your load balancer to ensure users don’t switch between application versions with each request. However, this also enables you to A/B test changes, as you can set up routing rules based on request headers or user properties (like location).

Though the load balancer pins each user to a version, you’ll need to ensure that components such as data stores are compatible with both versions of the application.

You may need extra capacity as the traffic volumes may not reflect the proportion of users assigned to each application version. For example, you might route a group of users to the new version only to find they are the most intensive system users. This can lead to insufficient resources to handle the canary group.

While canary deployments help you reduce the impact of any issues introduced by the new application version, this only works if you detect the issue early. If you discover the problem too late, you might have already routed all users to the new version.

Shadow Deployments

In cases where you can’t test a new application version using a sample of real traffic, you can use the shadow deployment strategy. This approach replays real requests in an isolated environment.

5 Deployment Strategies: The Pros and Cons (5)

Benefits of Shadow Deployments

Done correctly, shadow deployments have no impact on production systems. Any problems found in the new version have zero impact on real users.

You can compare the response times of the production requests with those in the shadow environment, which means the most accurate comparison for performance, errors and outcomes between the production and shadow environments.

Drawbacks of Shadow Deployments

You must be certain that repeating requests in an isolated environment will not have side effects. For example, if your application sends emails or other notifications to users, you must ensure these are switched off in the shadow environment. You also need to ensure that the shadow environment doesn’t issue calls to external services that might result in side effects.

Because requests are replayed from the production environment, which runs the previous application version, shadow environments will fail if they feature breaking changes to these requests.

By introducing shadow deployments, you double the amount of work you have to do in production. Both the real production environment and the shadow environment need to handle the real workload.

For your existing application, the risk of introducing shadow deployments may outweigh that of running a small sample of users against the new version with canary deployments.

When it comes to promoting the new software version to production, you’ll still need to use one of the other deployment strategies, as shadow deployments are a test-only strategy.

Choosing a Deployment Strategy

There are a few things to consider when selecting your deployment strategy.

  • Can you achieve your desired deployment frequency with your current approach?
  • Is downtime acceptable?
  • How much can you spend on infrastructure to reduce downtime?
  • What patterns does your system support and can you re-architect it?
  • How quickly do you need to redeploy a version?
StrategyZero-
downtime
Easy rollbacksPre-flight testsCost
RecreateNoNoNoNo additional resources
Blue/greenYesYesNoTwo environments must run at the same time during deployments, but not full-time
RollingYesNoNoSome additional resources required
CanaryYesYesYesNo additional resources
Shadown/an/aYesParallel environments needed throughout the test

The recreate strategy for deployments is rarely sufficient for modern applications, but it’s worth double-checking whether you need anything more complex. If your software isn’t used outside of local business hours, you can schedule an out-of-hours deployment and avoid any complexity.

In most cases, though, you need to eliminate the downtime. Continuous delivery and DevOps mean we’re moving toward more frequent deployments, which multiplies the impact of downtime to levels that make it hard to achieve your SLOs.

If the resource cost is acceptable, blue/green deployments provide the most benefits with the least complexity. Where cost containment is necessary, rolling deployments eliminate downtime at low cost, though you don’t get the rollback benefit of blue/green deployments.

Canary deployments and A/B deployments, which are canary deployments with more specific routing rules, allow you to test new software versions with real traffic, which can be a good way to spot problems your automated tests might miss. Ideally, you’d use what you learn from canary testing to increase the likelihood of detecting similar issues in your deployment pipeline in the future.

Shadow deployments require a robust architecture that guarantees the shadow environment has no side effects. This makes it hard to retrofit to existing applications, though some components may not be too far from this requirement. This is an advanced strategy with many trip hazards, so if you’re not going to get lots of valuable insights from this approach, it’s better to avoid it.

Modern infrastructure and CD tools can help you implement these deployment strategies without inventing them from scratch.

5 Deployment Strategies: The Pros and Cons (6)

Founded in 2012, Octopus Deploy helps DevOps teams at over 3,500 organizations accelerate reliable, repeatable, and traceable deployments for multi-cloud, hybrid, and on-premises environments. Octopus integrates hundreds of technologies, including Azure, AWS, GCP, and Kubernetes. Insight Partners is an investor in Octopus Deploy and TNS.

Learn More

The latest from Octopus Deploy

TRENDING STORIES

Steve Fenton is an Octonaut at Octopus Deploy, a DORA community guide and a six-time Microsoft MVP with more than two decades of experience in software delivery. He has written books on TypeScript (Apress, InfoQ), Octopus Deploy, and web operations.... Read more from Steve Fenton
5 Deployment Strategies: The Pros and Cons (2024)

FAQs

5 Deployment Strategies: The Pros and Cons? ›

Blue-Green Deployment: Seamless Transitions

Once the green environment is tested and ready, a seamless switch is made, making the green environment the new production environment. This strategy ensures zero downtime and rollbacks become a breeze if any issues arise during the switch.

What is the best deployment strategy? ›

Blue-Green Deployment: Seamless Transitions

Once the green environment is tested and ready, a seamless switch is made, making the green environment the new production environment. This strategy ensures zero downtime and rollbacks become a breeze if any issues arise during the switch.

What are types of deployment methods? ›

You can consider multiple deployment strategies and variations for rolling out new versions of software in a continuous delivery process. This section discusses the most common deployment methods: all at once (deploy in place), rolling, immutable, and blue/green.

What is the importance of deployment strategy? ›

The primary objective of a deployment strategy is to ensure a smooth and seamless transition from development to production, minimizing downtime, errors, and disruptions. Let us delve into the different aspects that make this strategy so essential in the software development lifecycle.

What is application deployment strategy? ›

What Are Deployment Strategies? A deployment strategy is a way to change or upgrade an application. The aim is to make the change without downtime in a way that the user barely notices the improvements. The most common strategy is to use a blue-green deployment.

What are the 5 steps of deployment? ›

Which steps are in the deployment process flow?
  • Remember to have a software deployment plan. ...
  • The actual development. ...
  • Testing your changes. ...
  • Deploying changes to the live environment. ...
  • Monitor your changes.

What is a strategic deployment? ›

Strategy Deployment is the creation of a high level plan for organisational improvement under conditions of uncertainty (the strategy), and the utilisation of that strategy by employees for a deliberate purpose (to achieve one or more goals).

Which deployment model is best and why? ›

The Comparison of Top Cloud Deployment Models
PublicHybrid
Data controlLittle to noneComparatively high
ReliabilityLowHigh
Scalability and flexibilityHighHigh
Cost-effectivenessThe cheapestCheaper than a private model but more costly than a public one
3 more rows

What is the most important deployment step? ›

Deployment should be tested before actually going live. You will verify that everything can be done within the time window and see if there's something you missed when planning. A good time to do the deployment exercise is when you start acceptance testing. This will also make your acceptance testing better.

How do you deploy a strategy? ›

Execution is Key
  1. Successfully acquiring and assembling necessary resources.
  2. Designing the right organizational structure.
  3. Hiring, training, and motivating the right people.
  4. Understanding and mitigating the critical risks that could undermine their strategy.
  5. Establishing the right organizational processes,

What is a continuous deployment strategy? ›

Continuous deployment is a strategy in software development where code changes to an application are released automatically into the production environment. The automation is driven by a series of predefined tests. Once new updates pass those tests, the system pushes the updates directly to the software's users.

What is the key concept of deployment? ›

Deployment is the process of rolling out code to a test or live environment while release is the process of shipping a specific version of your code to end-users and the moment they get access to your new features. Thus, when you deploy software, you're not necessarily exposing it to real-world users yet.

What are the three steps in the deployment process? ›

What are the Main Software Deployment Steps?
  • Planning and Assessment. The first step in the software deployment process is to carefully plan and assess the organization's needs and objectives. ...
  • 2. Development or Configuration. ...
  • Testing and Quality Assurance. ...
  • Deployment. ...
  • Monitoring and Maintenance.

Which deployment method offers the fastest deployment? ›

Choosing a deployment policy
  • All at once – The quickest deployment method. ...
  • Rolling – Avoids downtime and minimizes reduced availability, at a cost of a longer deployment time. ...
  • Rolling with additional batch – Avoids any reduced availability, at a cost of an even longer deployment time compared to the Rolling method.

Which military unit deploys the most? ›

Since 2002, the 10th Mountain Division has been the most deployed regular Army unit.

References

Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 5365

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.