Deployment strategies are the rules a team follows to move a new version of software into production: how much traffic the new version gets, how fast it gets it, and how you undo it if something breaks. The six common ones are recreate, rolling, blue-green, canary, shadow and A/B. Each trades speed, cost and risk differently, and none of them removes the need to test.
Most outages I read about in postmortems have nothing to do with bad code that nobody reviewed. The code was reviewed. It passed CI. It broke anyway, because production traffic did something staging never did. That is the gap a deployment strategy is supposed to cover.
The numbers back this up. In the 2025 DORA report data, the largest group of teams (about 26%) has a change failure rate between 8% and 16%, and only around 8.5% of teams sit in the 0 to 2% range. Put plainly, for most teams somewhere between one in twelve and one in six deploys causes a problem in production.
This guide walks through every major deployment strategy, where each one fits, how they map to Kubernetes, how to plan a rollback, and the part most guides skip: how to actually test the new version before and after it goes live.
What is a deployment strategy?
A deployment strategy is the plan for replacing the running version of an application with a new one. It decides three things: which servers or pods get the new code, which users see it and when, and what triggers a rollback.
It helps to separate two words people use interchangeably. Software deployment is the technical act of putting code onto infrastructure. A release is the moment users actually get the new behavior. They used to happen together. Now they often don’t. You can deploy on Tuesday, keep the feature dark behind a flag, and release it on Thursday to 5% of users. That split, deploy vs release, is what makes most modern strategies possible.
A few terms that come up in every section below:
- Downtime: the window where users get errors or nothing at all. Recreate has it. Most other strategies are built to avoid it.
- Blast radius: how many users a bad version can hurt before you notice. Canary keeps it small on purpose.
- Rollback time: how long it takes to get back to the last good version. Blue-green can do it in seconds. Rolling can take as long as the original rollout.
- Infrastructure cost: whether you need to run two full copies of the system at once.
Keep those four in mind. Every strategy is just a different answer to how much of each you are willing to pay.
The six types of deployment strategies
The six deployment strategies most teams choose from are recreate, rolling, blue-green, canary, shadow and A/B. Recreate is the simplest and the only one with planned downtime. Rolling is the Kubernetes default. Blue-green and canary trade extra cost for safer releases. Shadow and A/B are used for testing and experiments rather than plain rollouts.

Recreate deployment
Stop the old version, start the new one. That’s it. There is a gap in between where nothing is serving traffic, so recreate only makes sense for internal tools, batch jobs, or apps where two versions simply cannot run at the same time (for example, when a schema change breaks the old code). It is cheap and easy to reason about. It is also the strategy you will regret using on anything customer-facing.
Rolling deployment
A rolling deployment replaces instances a few at a time. Pod one gets the new version, passes its health check, then pod two goes, and so on. Users hit a mix of old and new during the rollout, which is fine as long as both versions can talk to the same database and the same downstream services. This is the default in Kubernetes for a reason: no extra infrastructure, no downtime, and it works for most stateless services. The weak spot is rollback. Undoing a rolling update is another rolling update, so a bad version can stay partially live for minutes.
Blue-green deployment
You run two identical environments. Blue is live. Green gets the new version and is tested while it sits idle. When green looks good, the router or load balancer flips all traffic to it in one move. If something goes wrong, you flip back. Rollback is nearly instant, which is the whole appeal. The cost is running double infrastructure during the switch, and the database is the hard part because both colors usually share it. The full breakdown is in our guide to blue-green deployment.
Canary deployment
A canary sends a small slice of real traffic, say 1% or 5%, to the new version while everyone else stays on the old one. You watch error rates, latency and business metrics. If they hold, you widen the slice in steps until the new version takes 100%. If they don’t, you pull it back and only a small group ever saw the problem. Canary is the most common form of progressive deployment, and it pairs well with automated analysis tools like Argo Rollouts or Flagger. More detail in our post on canary deployment.
Shadow deployment
In a shadow deployment, the new version receives a copy of live production traffic, but its responses are thrown away. Users only ever get answers from the current version. This lets you see how new code behaves under real load, with real payloads, without any user risk. The catch is side effects: if the shadow version writes to a database, sends emails or charges a card, you need to stub those out. We cover the setup, including traffic mirroring in Istio, Linkerd and NGINX, in the shadow deployment and traffic mirroring guide.
A/B deployment
A/B deployment routes users to different versions based on who they are (region, plan, device, a cookie) rather than a random percentage. It is less about safety and more about measuring which version performs better for the business. In practice, most teams run A/B tests through feature flags instead of separate deployments, because flags let you change the split without redeploying.
Deployment strategies compared
| Strategy | Downtime | Rollback speed | Extra infra cost | Blast radius | Best for |
|---|---|---|---|---|---|
| Recreate | Yes | Slow (redeploy) | None | All users | Internal tools, dev environments |
| Rolling | No | Slow to medium | None or minimal | Grows during rollout | Most stateless services |
| Blue-green | No | Instant (switch back) | High (2x during switch) | All users at switch | Critical apps that need fast rollback |
| Canary | No | Fast | Low | Small, controlled | High-traffic services, risky changes |
| Shadow | No | Not needed (no user traffic) | Medium to high | None | Rewrites, migrations, performance checks |
| A/B | No | Fast (change the split) | Low | Targeted segment | Product experiments |
How to choose a deployment strategy for your team
Pick the strategy by asking three questions: can you afford downtime, how fast do you need to roll back, and how much traffic do you have to test with? Low traffic and tolerance for a short outage point to recreate or rolling. Strict uptime and instant rollback point to blue-green. High traffic and risky changes point to canary.
There is no best strategy in the abstract. There is a best strategy for a given service, team and budget. A few rules of thumb that hold up well in practice:
- Start with rolling. If you run on Kubernetes, you already have it. For most stateless APIs it is good enough, and adding complexity before you need it just gives you more ways to fail.
- Move to canary when traffic makes it meaningful. A 1% canary on a service that gets 50 requests a minute tells you almost nothing. On a service doing 5,000 a minute, 1% is a real sample within a few minutes.
- Use blue-green when rollback speed matters more than cost. Payments, auth and checkout flows are the classic cases. Being able to flip back in seconds is worth paying for a second environment.
- Reach for shadow when the change is big and the behavior should not change. Rewriting a service in a new language, swapping a database driver, upgrading a major framework version. These are the changes where you want to compare old and new on identical real traffic.
- Keep A/B for product questions. If the question is “which version converts better”, that is an experiment, not a rollout.
Team maturity matters too. Canary analysis needs decent observability. If you cannot tell within ten minutes whether error rates went up, a canary just delays the same outage. Fix monitoring first, then get fancy with traffic.
And your deployment frequency matters. Teams that ship several times a day tend to do better with small, automated rollouts through a CI/CD pipeline, because each change is small. If you deploy once a month, every release carries more risk, and a strategy with a fast rollback (blue-green) earns its cost. If you are working on getting to that daily cadence, our post on deployment automation covers the pipeline side.
Deployment strategies in Kubernetes
Kubernetes supports two deployment strategies natively: RollingUpdate (the default) and Recreate. Blue-green, canary and shadow are built on top using Services, Ingress controllers, a service mesh like Istio or Linkerd, or a controller such as Argo Rollouts or Flagger.
The built-in options live in the strategy field of a Deployment:
Two settings do most of the work in a Kubernetes rolling update:
- maxSurge is how many extra pods Kubernetes can create above the desired count during the rollout. Both settings default to 25%.
- maxUnavailable is how many pods can be down at once. Setting it to 0, as above, is the usual way to get a zero downtime deployment: Kubernetes never removes an old pod until a new one is ready.

The readiness probe matters more than people expect. Without one, Kubernetes treats a pod as ready the moment the container starts, sends it traffic, and you get errors while the app is still loading config or warming caches. Most “Kubernetes caused downtime during deploy” stories trace back to a missing or lazy readiness probe.
For everything beyond rolling and recreate, here is how teams usually build it:
| Strategy | Common way to do it in Kubernetes |
|---|---|
| Blue-green | Two Deployments (blue and green), one Service whose selector you switch, or Argo Rollouts’ blueGreen strategy |
| Canary | Weighted routing in Istio, Linkerd or an Ingress controller, or Argo Rollouts / Flagger with automated analysis |
| Shadow | Traffic mirroring in Istio (mirror), Linkerd, or NGINX’s mirror directive |
| A/B | Header or cookie based routing in the mesh or Ingress, or feature flags inside the app |
If you are testing services that run on Kubernetes, the hardest part is usually the dependencies around them, not the cluster itself. Keploy’s Kubernetes testing setup records real traffic to a service along with its calls to databases and other pods, so you can replay it later without standing up every dependency.
Rollback planning
A rollback plan should be written before the deploy, not during the incident. It needs a clear trigger (which metric, what threshold), a single owner who can make the call, a tested command or switch to go back, and an answer for the database, because code is easy to roll back and data usually is not.
Every strategy above has a rollback story, but they are not equal. Blue-green gives you a switch. Canary gives you a dial you turn back to zero. Rolling gives you another rollout in reverse, which in Kubernetes is kubectl rollout undo deployment/orders-api. Recreate gives you a redeploy and more downtime.
The part that bites teams is almost always the database. If version 2.4 adds a column and starts writing to it, rolling back to 2.3 is fine. If 2.4 renames a column, 2.3 breaks the second it comes back. The safe pattern is expand and contract:
- Ship a migration that only adds things (new columns, new tables). Old code ignores them.
- Deploy the new code that writes to both old and new structures.
- Once the new version is stable and you are sure you won’t roll back, remove the old structures in a later release.
It is slower. It is also the only approach that keeps rollback a real option at every step.
A short checklist worth keeping next to every release:
- What metric tells us to roll back, and what number?
- Who decides, and are they online during the deploy?
- Have we actually run the rollback command on this service recently?
- Is the database change backward compatible with the previous version?
- Are there async jobs or queues that will process messages from the new version after we roll back?
That last one gets missed a lot. A rollback fixes the API, but the 40,000 messages the new version already put on a queue are still there, in the new format.
How to test before and after each deployment
Every deployment strategy still needs a test gate. Before the deploy, run regression tests built from real production traffic against the new version. After the deploy, run post deployment testing and continuous validation: smoke tests, synthetic checks and metric comparisons between old and new versions until the rollout is complete.
Here is the uncomfortable truth about all six strategies: they limit damage, they don’t prevent it. A canary still sends real users to broken code. They are just fewer users. Blue-green still flips everyone to green at once. If green was never tested against realistic traffic, you have a very fast way to break everything.
So the question is not which strategy to use instead of testing. It is what testing each strategy needs.
Before the deploy
The weakest part of most pipelines is that tests are written by hand, based on what the developer thought users would send. Production traffic is messier. Odd headers, missing fields, huge payloads, clients still on an API version from two years ago. Good integration testing helps with service-to-service contracts, but it only covers the cases someone thought to write down.
This is where Keploy fits. Keploy records real API calls to a service, along with the responses from its dependencies (databases, caches, other services), and turns them into test cases and mocks. Before a new version gets any user traffic, you replay those recorded calls against it and compare the responses to what the old version returned. If the new version answers differently, you see exactly which request and which field changed. It is the same idea as shadow testing, moved earlier in the pipeline, so the check runs in CI rather than in production.

How it plugs into each strategy:
| Strategy | Where the test gate goes |
|---|---|
| Recreate | Replay recorded traffic in staging before stopping the old version |
| Rolling | Gate the image in CI so a failing version never starts rolling |
| Blue-green | Replay traffic against green while it is idle, before the switch |
| Canary | Replay first, then let the canary prove it under live load |
| Shadow | Compare shadow responses to live responses for the same requests |
| A/B | Test each variant separately before splitting traffic |
After the deploy
Post deployment testing is the second half. Once the new version is live, keep checking:
- Smoke tests against the critical paths (login, checkout, the three endpoints that make money) within the first minutes.
- Metric comparison between old and new: error rate, p95 and p99 latency, saturation. Canary tools automate this, but you can do it by hand with dashboards.
- Continuous validation, meaning the checks keep running for hours, not just the first five minutes. Memory leaks and slow queue buildup don’t show up right away.
If you want to see how recorded traffic replay works with your own services, Keploy’s API testing page walks through the setup. You can also look at environment replay for testing against recorded dependencies without spinning up a full staging stack.
FAQs
What is the safest deployment strategy?
Canary is usually the safest for user-facing services because only a small share of users ever sees a bad version, and you can stop the rollout early. Shadow deployment is even safer in one sense, since no user ever gets a response from the new version, but it is a testing step rather than a full release. The safest setup combines both: test the new version on mirrored or replayed traffic first, then roll it out as a canary.
What is the difference between blue-green and canary deployment?
Blue-green switches all traffic from the old environment to the new one at once and keeps the old one ready for an instant rollback. Canary shifts traffic gradually, starting with a small percentage and increasing it as metrics stay healthy. Blue-green gives faster rollback but costs more and exposes everyone at the moment of the switch. Canary costs less and limits exposure but takes longer to finish.
Which deployment strategy gives zero downtime?
Rolling, blue-green, canary, shadow and A/B can all deliver zero downtime deployments. Only recreate has built-in downtime, because it stops the old version before starting the new one. In Kubernetes, a rolling update with maxUnavailable set to 0 and a proper readiness probe is the simplest way to get zero downtime without extra infrastructure.
Can you combine deployment strategies?
Yes, and most mature teams do. A common setup is to test a new version on mirrored or replayed traffic first, release it as a canary, and keep individual features behind feature flags inside that release. Blue-green and canary also mix well: you bring up the full green environment, then shift traffic to it in steps instead of all at once.
What is the difference between a deployment strategy and a release strategy?
A deployment strategy controls how new code reaches production servers. A release strategy controls when users actually see a change. You can deploy code with a feature switched off and release it days later, which is what feature flags allow. Keeping deploy vs release separate lets teams manage infrastructure risk and product risk on their own terms.

