Software Deployment Strategies: Blue-Green, Canary, Rolling and Best Practices

Deployment strategies decide how a new version of your software reaches users. You can replace everything at once, update one server at a time, switch between 2 identical environments or start with a small share of traffic. Each choice trades downtime, rollback speed, cost and risk in its own way.

The release is the last step of web app development, and the one users notice when it goes wrong. Throughout, we use an invented invoicing app for small businesses that ships a new checkout, the page where clients pay their invoices.

Key takeaways

  • A deployment strategy is how a new version replaces the old one in production: how traffic moves to it, how much downtime users see and how you undo it.
  • Recreate is the simplest strategy but takes the app offline. A rolling deployment replaces servers in batches with no downtime, while both versions run at once.
  • Blue-green deployment switches all traffic to a second, identical environment and switches back just as fast, at the cost of running both.
  • Canary deployment sends a small share of traffic to the new version first and widens it while the metrics hold. Feature flags do the same for one feature, without a redeploy.
  • Whatever you choose, automate the pipeline, keep staging close to production, change the database in steps both versions can use and decide in advance when you’ll roll back.
  • Blue-green and canary pay off when outages are expensive. Most company websites and early platforms do well with a staging site, an approval step and a backup taken just before each release.

What is a deployment strategy?

A deployment strategy is the method a team uses to replace the running version of an application with a new one. It sets how the new code reaches the servers, how users’ traffic moves over to it and how the team goes back if something breaks.

People often use deployment and release to mean the same thing, but they’re 2 steps. Deployment puts a version of your code on the production servers, while release makes a feature available to users.

Feature flags let you do the 2 at different times. Pete Hodgson calls release flags the most common way to follow the principle of “separating [feature] release from [code] deployment” (Pete Hodgson, 2017).

The choice matters because releases are risky. In Google’s experience, “a majority of incidents are triggered by binary or configuration pushes” (Google SRE Workbook, 2018).

Tests never cover everything, and some defects will reach production. The strategy decides how many users a bad release reaches and how quickly you can take it back.

Every strategy balances the same 5 things.

  • Downtime: whether users lose the app while the new version starts.
  • Rollback: how fast you can get back to the last version that worked.
  • Cost: the extra servers or environments the release needs.
  • Exposure: how many users a bad version reaches before anyone notices.
  • Effort: the routing, monitoring and compatibility work it asks of your team.

Types of deployment strategies

There are 7 common strategies. The first 4 replace one version with another. The last 3 decide who sees a change, or test it where no one sees it.

Recreate (big bang) deployment

A recreate deployment stops every copy of the old version, then starts the new one. In Kubernetes, the Recreate strategy kills all existing Pods before it creates new ones (Kubernetes docs). Some guides call it a big bang deployment when a whole system changes at once.

It’s the simplest strategy, and it needs no extra servers. The price is downtime. AWS describes its all-at-once method as suitable if you can accept a short loss of service (AWS Elastic Beanstalk docs).

Going back means redeploying the old version, with the same downtime. Recreate fits internal tools, staging environments and planned maintenance windows. It also fits changes the 2 versions can’t share, such as a database change the old version can’t read.

Rolling deployment

A rolling deployment replaces the old version in batches. A load balancer takes each server out of service while it updates and returns it once the update is done (AWS CodeDeploy docs). Most servers keep serving throughout, and users see no downtime.

It’s the default strategy for a Kubernetes Deployment, which lets at most 25% of the desired Pods be unavailable during an update unless you change it (Kubernetes docs).

Rolling: one server at a time. Under the title, in gray: The invoicing app on 4 servers behind a load balancer. Five rows from top to bottom, each with 4 server tiles. Start: v1, v1, v1, v1, all white. Step 1: v2 in ink, then v1, v1, v1. Step 2: v2, v2, v1, v1. Step 3: v2, v2, v2, v1. Done: v2, v2, v2, v2, all ink. A bracket beside steps 1 to 3 reads: v1 and v2 serve users at the same time. Under the rows: Rollback: the same steps in reverse, from Done back to Start.

The catch is that both versions serve users until the rollout ends. They have to work with the same database and the same API calls, and one user can reach the old version and then the new one.

Rolling back is another rolling update, back to the previous revision that Kubernetes keeps in the rollout history. A plain rolling update also gives you little control. The Argo Rollouts project lists few controls over its speed, no control over the traffic sent to the new version and no automatic rollback on failure (Argo Rollouts docs).

Blue-green deployment

A blue-green deployment keeps 2 production environments, blue and green, as identical as possible. You test the new version on the idle one, then switch the router so all requests go to it (Martin Fowler, 2010).

Blue-green deployment. Under the title, in gray: All users move at once, and move back just as fast. Three panels from left to right. Each has All users at the top with an arrow to a Router, 2 environment cards under it, Blue and Green, and one Database at the bottom that both cards connect to. The router’s arrow points to the live card, in ink with white text; the other card is light gray. 1, Before: Blue, v1, Live. Green, v2, Testing. 2, Switch: Blue, v1, Idle. Green, v2, Live. 3, Rollback: Blue, v1, Live. Green, v2, Failed, with a red X. Under the panels: One database serves both, so it has to work with v1 and v2.
Source: Martin Fowler, 2010

Google’s SRE team calls rollback “a trivial reversal of the router change” and names the downside, a setup that uses twice as many resources (Google SRE Workbook, 2018). Once the new version is stable, the idle environment becomes the staging area for the next release (Martin Fowler, 2010).

The database is the hard part, because both environments usually share it. Martin Fowler’s advice is to separate schema changes from application upgrades.

First change the schema so it supports both versions, deploy that and check that everything works, which gives you a rollback point. Then deploy the new version of the application.

Canary deployment

A canary deployment sends a small share of real traffic to the new version first, then widens it while the numbers hold. Google’s SRE team defines canarying as “a partial and time-limited deployment of a change in a service and its evaluation” (Google SRE Workbook, 2018).

The part that gets the change is the canary, and the rest is the control. The name comes from coal mines, where a caged canary would die of toxic gas before the miners did (Danilo Sato, 2014).

Canary: a small share first. Under the title, in gray: The new checkout gets more traffic while it holds up. Four stage cards from left to right, each with the share of traffic on v2 and a bar filled to that share in ink. Stage 1: 5% on v2. Stage 2: 25% on v2. Stage 3: 50% on v2. Stage 4: 100% on v2. Between the stages, 3 gates, each a shield with a check. A dashed line runs from each gate down to one card: If v2 does worse at a gate, roll back: send all traffic to v1. Under it, a note: At each gate, compare v2 with v1: errors, response time and successful payments.
Source: Google SRE Workbook, 2018

In Google’s example, a release that fails 20% of requests, sent to a canary of 5% of traffic, gives a 1% error rate overall (Google SRE Workbook, 2018). That’s also the trap, because the totals hide the problem. Compare each metric for the canary with the control, and roll back if the canary’s error rate drifts too far from the control’s.

Rolling back means sending the canary’s users back to the old version until the problem is fixed (Danilo Sato, 2014). AWS CodeDeploy’s canary presets shift 10% of traffic first and the other 90% between 5 and 30 minutes later (AWS CodeDeploy docs). On Kubernetes, Argo Rollouts can shift traffic in steps and promote or roll back a release based on its metrics (Argo Rollouts docs).

Canaries suit busy services you can monitor by version. They’re harder for apps installed on phones and computers, where you control less of when the update happens (Danilo Sato, 2014). Sato notes they’re also called phased or incremental rollouts.

Skipping the canary can be expensive. On July 19, 2024, a CrowdStrike content update crashed the Windows hosts that received it in the 78 minutes before it was reverted (CrowdStrike, 2024).

Microsoft estimated that it affected 8.5 million Windows devices (Microsoft, 2024). In its review, CrowdStrike committed to a staggered deployment strategy that starts with a canary deployment.

A/B testing

A/B testing looks like a canary, because both send part of the traffic to something new. The goal is different.

A canary checks whether a release is safe. An A/B test compares variants to test a hypothesis, such as whether a shorter checkout gets more invoices paid (Danilo Sato, 2014).

Keep the 2 apart. An A/B test can take days to reach statistical significance, while a canary rollout should finish in minutes or hours, and business metrics watched for a canary can skew the test. Teams usually run A/B tests with feature flags that keep each user in one group (Pete Hodgson, 2017).

Feature flags

In OpenFeature’s words, a feature flag is “an if/else statement that can be controlled at runtime” (OpenFeature). New code ships to production switched off. You then turn it on for your team, for a share of users or for everyone, without another deployment.

Deploy, then release. Under the title, in gray: The new checkout ships switched off, then turns on in steps. A settings card headed New checkout, with 3 rows and a switch in each. Staff: On. 10% of accounts: On. Everyone else: Off. Beside them, a separate Kill switch, off, with the note Turns it off for everyone, no redeploy. Under the card, 2 phone screens from the same release, side by side and cut off by the bottom edge. Flag off, the current checkout: the logo and a Menu button, the heading Pay invoice and the subtitle Invoice 1042, 3 fields (Card number, Expiry date and Security code), a Pay button and the top of an Amount due card, $1,250. Flag on, the new checkout: the same logo, Menu button, heading and subtitle, 2 options, Pay by card (Credit or debit card, selected) and Pay by bank transfer (From your bank account), a Pay now button and the same Amount due card.

That makes a canary possible for a single feature. In Pete Hodgson’s example on Martin Fowler’s site, a team turns a new feature on for a random 1% of users and watches key business metrics for both groups. Once the team is confident, it turns the feature on for everyone (Pete Hodgson, 2017).

A long-lived flag can also act as a kill switch, which lets operators turn off a feature that isn’t vital when the system is under unusual load. Flags have a carrying cost, though, since every flag adds a code path to test.

Remove release flags once a feature is fully out. Hodgson suggests a release flag generally shouldn’t stay much longer than a week or two. OpenFeature, an open specification for flags, keeps your code independent of any one flag service.

Shadow deployment

A shadow deployment runs the new version next to the old one and sends it a copy of live traffic. The old version still answers every user, and the new version’s responses are thrown away (Google SRE Workbook, 2018). Istio’s name for it is traffic mirroring, also called shadowing, with the copy kept out of the path of the user’s request (Istio docs).

It tests the new version under real load with no risk to users. You can also compare both versions’ answers, which Martin Fowler describes as parallel running of a reimplemented feature (Martin Fowler, 2020).

Be careful with anything that writes data, because copies of traffic can affect a system that keeps state. A shadow copy of the invoicing app’s checkout would need its payments stubbed out, or clients would pay twice.

How to choose a deployment strategy

Start with what a bad release would cost you, then compare the options.

Deployment strategies compared

For the first 4 strategies, the downtime and rollback cells follow AWS’s comparison of deployment methods (AWS Elastic Beanstalk docs). The rest sums up the sources above.

Strategy Downtime Rollback Cost Risk to users When to use
Recreate Yes, while the new version starts Redeploy the old version, with more downtime Lowest, no extra servers Everyone gets a bad version at once Internal tools, staging and planned maintenance windows
Rolling None Another rolling update, back to the previous revision Low, a few extra servers at most Grows with each batch, while both versions run Apps on several servers or containers
Blue-green None Switch the router back, at once High, 2 full environments Everyone, once traffic switches Releases that need an instant way back
Canary None Send the canary’s traffic back to the old version Low, a small slice of servers A small share at first Risky changes on busy services you can monitor by version
A/B testing None Turn the variant off Low, plus the time a test needs The test group Product decisions, not release safety
Feature flags None Turn the flag off, no redeploy Low, but each flag is code to test and remove Only the groups you choose Releasing one feature in steps, and kill switches
Shadow None Nothing to undo, since users never saw it A second copy that takes the mirrored traffic None, if it doesn’t write data Rewrites and load tests of back-end services

No strategy wins every row, and they combine. A rolling or canary deployment can carry the release while feature flags control the risky features inside it.

Questions that narrow the choice

  • Can users live with a short outage? For an internal tool or an app with quiet hours, recreate in a maintenance window is enough.
  • How fast must you undo a release? If you need an instant way back, use blue-green or put the change behind a flag.
  • Can you pay for a second environment? If not, use a rolling or canary deployment.
  • Do you need real traffic before everyone gets it? Use a canary, and make sure you can monitor each version on its own.
  • Can both versions run at once? If a database change breaks the old version, make the change backward compatible first or use recreate.
  • Is it one feature rather than a whole release? Ship it behind a flag and release it in steps.

Back to the invoicing app. Its team releases the new checkout as a canary, because payments are the riskiest page in the app and the team can compare payment errors between versions.

The checkout also sits behind a flag that works as a kill switch. If payments start failing, the team turns the flag off at once instead of rolling back the whole release.

When a small team doesn’t need blue-green or canary

Most websites and early platforms we build don’t need blue-green or canary releases. Those strategies pay off when many people use an app at once and every minute of a bad version costs money.

A small team with a company site that changes a few times a month is better served by a staging site, an approval step and a fresh backup before each release. We’d add a second environment or a canary once an outage costs more than running them.

Software deployment best practices

A strategy limits the damage of a bad release. These software deployment best practices make bad releases rarer and easier to undo, whichever strategy you pick.

Plan each release

Write a short deployment plan for any release that touches payments, data or many users. Say what changes and why, which strategy you’ll use and when the release happens.

Name who deploys, who watches the metrics and who can call a rollback. Keep the plan to a page, and add what you learned after each release.

Automate the pipeline with CI/CD

In continuous integration, each member of a team merges their changes into a shared codebase at least daily. An automated build with tests checks each merge (Martin Fowler, 2024).

Continuous delivery keeps the software releasable at any time. Continuous deployment goes a step further and sends every change that passes the pipeline to production automatically (Martin Fowler, 2013). Google’s release engineering principles add that “deployments should be performed by computers, not humans” (Google SRE Workbook, 2018).

A release pipeline. Under the title, in gray: The path every change takes to production. Six steps from left to right, each an icon tile joined by arrows, with a label under it. Commit: reviewed and merged. Build: one build for every environment. Automated tests: from unit to end-to-end. Staging: manual checks and approval. Production: rolls out in stages. Monitoring: the 4 golden signals and user feedback. Above the steps, a line from Automated tests back to Commit, with a red X: A failed test stops the release. Another from Monitoring back to Production: Roll back to the last good build. Under the steps, a long line from Monitoring back to Commit: Fixes and feedback go into the next change.

Run the fastest tests first.

  • Unit tests check one piece of code.
  • Integration tests check that pieces work together.
  • End-to-end tests run whole flows, such as paying an invoice.

Automated tests catch regressions on every change, and a person exploring the staging site finds what scripts miss. Services such as GitHub Actions and GitLab CI/CD run these pipelines, building and testing each pull request and deploying merged changes (GitHub Docs; GitLab Docs).

Keep each change small. DORA’s research suggests making each change as small as possible, because smaller changes move through delivery more easily and are easier to recover from (DORA, 2026).

Build once and promote the same build

Build each version once and move that same build through every environment. The twelve-factor method separates the build, release and run stages and gives each release a unique ID, such as a timestamp or an incrementing number (The Twelve-Factor App).

A release can’t be changed once it’s created, which makes rolling back to the previous one simple. Settings and secrets join the build at release, so the build that passed on staging is the one that runs in production.

Keep staging close to production

The twelve-factor rule is to keep development, staging and production as similar as possible (The Twelve-Factor App). Use the same kind of database, cache and queue everywhere, or a bug that only shows up with the production database can’t appear on staging.

Platforms such as Vercel and Netlify also build a preview of each pull request, which gives every change its own address for review (Vercel docs; Netlify docs).

Keep a staging website out of search. A noindex rule, set as a meta tag or an HTTP header, tells Google to drop a page from its results (Google Search Central). Google doesn’t support the rule in robots.txt.

The classic launch-day mistake is that rule coming along when the staging copy goes live. The new site then asks Google to drop its pages, and nobody notices until search traffic falls. Our own staging site carries the same rule, so we check the live pages for it right after every launch.

Change the database in steps you can undo

Databases make rollbacks hard, because data written by the new version may not fit the old one. The safe pattern is parallel change, also called expand and contract. It splits a change that would break existing code into 3 phases (Danilo Sato, 2014).

  • Expand: add the new structure next to the old one, such as a new column, so both versions work.
  • Migrate: move the code and the data to the new structure, in batches you can check.
  • Contract: remove the old structure once nothing uses it.

Each phase ships on its own, and each one is a point you can roll back to. Take a backup before the migration and restore it once on staging, because an untested backup may fail when you need it.

Without a way back, the only fix is to patch and redeploy during the outage. Google’s SRE team says that will almost certainly prolong the impact on users (Google SRE Workbook, 2018).

If the release changes how your app exchanges data with other systems, test those connections on staging as well. Our post on API integration strategy covers how to plan them.

Watch every release

Decide before the release what you’ll watch and what will trigger a rollback. Google’s SRE book names 4 golden signals for a system that serves users, which are latency, traffic, errors and saturation (Google SRE book). For a canary, split each metric by version and use measurement windows no longer than the canary itself (Google SRE Workbook, 2018).

Watch at busy times, too. Performance defects typically show up only under heavy load, and a release at a quiet hour may not trigger them (Google SRE Workbook, 2018).

Then listen to users. Support tickets and feedback catch what dashboards miss, such as a confusing new screen, and each fix goes into the next change.

To track your process over time, DORA measures software delivery with 5 metrics (DORA, 2026). Its research shows that speed and stability aren’t trade-offs, and top performers do well on all 5.

  • Change lead time: how long a change takes from commit to production.
  • Deployment frequency: how often you deploy.
  • Failed deployment recovery time: how long it takes to recover from a deployment that fails.
  • Change fail rate: the share of deployments that need immediate action, such as a rollback or a hotfix.
  • Deployment rework rate: the share of deployments that weren’t planned and came out of an incident in production.

A production-readiness checklist

Run through this list before any release that matters. It borrows from Google’s original launch checklist, which covers areas such as rollout planning, monitoring and backups (Google SRE book).

  • The build passed every automated test, and it’s the same build that ran on staging.
  • Someone other than the author has reviewed the change.
  • Database changes work with both the old and the new version.
  • A fresh backup exists, and restoring it has been tested.
  • New features sit behind flags that start switched off.
  • Dashboards show errors, latency, traffic and saturation for the new version, with alerts set.
  • The rollback steps are written down, and one person owns the decision.
  • Production settings and secrets are in place, outside the code.
  • Certificates, domains and redirects are checked, and third-party services can take the extra traffic.
  • Support knows what’s shipping and when.
  • On a website, the staging site’s noindex rule stayed behind, and forms and analytics work on the live site.

How we release client sites

Nothing we build goes straight to a live site. A new website and a small fix take the same route, through a staging site and your approval, with a backup taken just before release. That fixed route is what keeps our launch days uneventful.

The route closes the last 2 phases of our web design process. In development, the scope includes deploying your CMS, building the custom pages, adding the animations and transitions and setting up analytics and on-site SEO.

In QA and migration, we benchmark the site for loading, responsiveness and speed and check that it works reliably on all browsers and mobile devices.

How we release a client site. Under the title, in gray: The last steps of every website we build. Five cards from left to right, joined by arrows, each with a number, a name, a note and who does it. 1, Staging site: we build it there. Our team. 2, QA: page speed, phones and browsers. Our team. 3, Approval: you review it on staging. You. 4, Backup: taken just before the release. Our team. 5, Live site: the site goes live. Our team. Under the cards, an arrow from Live site back to Backup: If something breaks, we restore the backup.

At the end of a project, the last steps run in a set order: CMS setup, QA, your approval, a client survey, then the project transfer and delivery. Your team also receives CMS training and documentation for working on the site after launch.

On the WordPress sites we support, later changes take the same route. Each one starts on a local copy, and the staging site runs on our own hosting.

What we check before a launch

In practice, QA means every template in Chrome and Safari, at phone, tablet and desktop widths. Many of the bugs we catch show up in only one of them, often in Safari on an iPhone. We also send every form and follow every link.

Our rollback plan

For the websites we build, the rollback plan is short. It’s a full backup of the files and the database, taken just before the release.

If the live site breaks, we restore the backup first. Then we fix the problem on staging and release again, instead of debugging the live site while your visitors are on it.

Software and web app projects

On software and web app projects, our development work includes test plans with test cases and scenarios, automated or manual test runs and defect tracking. It also covers CI/CD, infrastructure as code and continuous monitoring.

That matters most on platforms where one release reaches several kinds of users and their money. DDDkit, a marketplace of editable 3D assets, took 780+ hours from research to deployment. A release there can touch subscriptions, single-pack purchases and the payouts creators receive.

Rehearse the rollback

Start with the way back. Before your next release, write down how you would undo it, then try those steps on staging and time them.

Add what’s missing next, such as an automated pipeline, a staging copy close to production and a backup you’ve restored. Choose the strategy last, by what a bad release would cost your users.

For many web apps, a rolling deployment with flags for the risky features is a sound first step. A canary comes once you can monitor each version on its own. If you’d like help, our development team can set up CI/CD and the release with you.

Find the answers to your frequently asked questions

The main deployment strategies are recreate, rolling, blue-green, canary and shadow, with A/B testing and feature flags for controlling who sees a change. Recreate stops the old version before starting the new one. Rolling replaces servers in batches. Blue-green switches traffic between 2 environments, canary starts with a small share of traffic and shadow tests with copied traffic.
Blue-green moves all traffic at once from the old environment to a second, identical one, and it can switch back just as fast. Canary moves a small share of traffic to the new version first and widens it while its metrics hold. Blue-green needs twice the infrastructure during the release, while canary needs routing and monitoring by version.
Rolling, blue-green and canary deployments all avoid downtime, because some servers keep serving users throughout the release. Shadow deployments and feature flags don’t interrupt users either. Recreate, also called big bang or all at once, is the one that takes the app offline while the new version starts. Zero downtime also needs database changes that both versions can use.
A common split is the one AWS CodeDeploy uses, in-place and blue/green deployments. An in-place deployment updates the existing servers, stopping and restarting the application on each one, which CodeDeploy does as a rolling update. A blue/green deployment installs the new version on a separate set of servers and moves traffic to them, while the old set can keep running.
Deployment puts a new version of your code on the production servers. Release makes a feature available to users. The 2 can happen at different times. With feature flags, code is deployed switched off and released later, to your team first, then to a share of users and finally to everyone, without another deployment.
A deployment plan says what changes and why, which strategy you’ll use and when the release happens. It names who deploys, who watches the metrics and who can call a rollback. It also lists the checks before the release, the signals that would trigger a rollback, the rollback steps and how support and users will hear about the change.
It depends on the strategy. Blue-green switches the router back to the old environment, and a canary sends its traffic back to the old version. A rolling update rolls back batch by batch, and a feature flag is simply turned off. Database changes need their own plan, which is why they should work with both versions.
Automate the pipeline so every change is built and tested the same way, and deploy the same build to staging and production. Keep staging close to production, make database changes in steps both versions can use and take a tested backup first. Ship small changes, watch errors and latency during every release and decide in advance when you’ll roll back.

Launching a new site or app?

Tell us what you’re building and when it has to go live. We’ll reply within 1 business day.

Get in touch

Have a project in mind?
Let’s get in touch

Tell us about your project. If our partnership isn’t the right fit, we’re happy to share insights that could still help you.

Get in touch