System Atlas
the atlas

Deployment strategies

Five ways to release new code — trading downtime, risk, rollback speed and cost against each other.

the gist

Deployment strategies decide how new code replaces old. Recreate stops the old version and starts the new one, causing downtime. Rolling replaces instances gradually. Blue-green keeps two full environments and flips traffic instantly. Canary sends a small slice of traffic to the new version first, watching metrics before widening. A/B routes users by attribute to test variants. Each shifts traffic differently and trades downtime, risk, rollback speed and cost.

ANALOGY // Reopening a restaurant with a new menu: close for the night and reprint everything (recreate), swap dishes table by table (rolling), open an identical second dining room and usher everyone over (blue-green), or test the new dish on a few tables first (canary).
living diagram01 / 06
Recreatedowntime · cheapest · slow rollback
Rollinggradual · no downtime · mixed versions
Blue-greeninstant switch & rollback · 2x cost
Canarysmall % first · smallest blast radius
A/B testingroute by attribute · compare variants
Bar height ≈ safety: low downtime + fast rollback + small blast radius.
01

The dimensions

Every deployment strategy is a trade-off across four axes: downtime (are users ever cut off?), risk (how many users hit a bad release?), rollback speed (how fast can you undo it?), and cost (how much extra infrastructure does it need?). No strategy wins on all four, so the right choice depends on what your service can tolerate. The rest of this is how each one moves traffic and where it lands on those axes.

02

Recreate

The recreate strategy stops every instance of the old version, then starts the new one — a hard cutover. It's the simplest and cheapest because you never run two versions at once, but there's a window of downtime while the old is down and the new is starting. Rollback means redeploying the previous version, so recovery is slow. It suits internal tools and anything that can accept a maintenance window.

03

Rolling

A rolling deployment replaces instances in batches: take down a few old ones, bring up new ones, repeat until the fleet is upgraded. Traffic shifts gradually and there's no downtime, but for a while old and new versions serve requests side by side, which they must both tolerate. Rollback is slower than blue-green because you have to roll the fleet back batch by batch. It's the sensible default in Kubernetes.

04

Blue-green

Blue-green keeps two complete environments — blue (current) and green (new) — and shifts all traffic from one to the other at once by flipping a router or load balancer. Because the old environment stays running and idle, rollback is instant: flip back. The price is cost, since you run double the infrastructure during the switch, and you must handle database changes carefully across both. It's ideal when you need zero downtime and instant recovery.

05

Canary

A canary release sends a small slice of traffic — say 1% or 5% — to the new version while everyone else stays on the old one, then watches error rates and latency. If the metrics hold, you progressively widen the slice to 100%; if they don't, you pull the canary and only a handful of users were affected. This gives the smallest blast radius of any strategy, at the cost of needing good monitoring and traffic-splitting.

06

A/B testing

A/B testing routes users to different versions by an attribute — region, device, user cohort, or a random bucket — to compare them, usually to measure a product or business metric rather than just to release safely. Unlike a canary, which is about de-risking a rollout, A/B is about learning which variant performs better. The two techniques share the same traffic-splitting machinery but answer different questions.

the full picture
01

The question every release has to answer

Shipping new code is not just build and run — it's the delicate act of replacing a running old version with a new one *while users are actively depending on it.* How you manage that swap is your deployment strategy, and it's one of the highest-stakes decisions in operating a service, because a botched release is how outages happen.

Every strategy is really answering the same question — "how do we move traffic from the old version to the new one?" — and every answer is a trade-off across four axes:

  • Downtime — is there any window where users can't be served?
  • Risk (blast radius) — if the new version is broken, how many users hit it before you notice?
  • Rollback speed — when something goes wrong, how fast can you get back to the known-good version?
  • Cost — how much extra infrastructure does the strategy require while it runs?

No single strategy wins on all four. Recreate is cheap but has downtime; blue-green has instant rollback but doubles cost; canary has the smallest blast radius but demands good monitoring. Choosing well means knowing what *your* service can tolerate.

02

Recreate and rolling

Recreate is the simplest possible strategy: stop all instances of the old version, then start the new one. It's a hard cutover. Because you never run two versions simultaneously, it's the cheapest option and avoids any version-compatibility headaches — but it has an unavoidable downtime window between the old going down and the new coming up healthy. Rollback means redeploying the old version from scratch, so recovery is slow. Recreate is perfectly fine for internal tools, batch systems, or anything that can accept a maintenance window; it's a poor fit for user-facing services that must stay up.

Rolling deployment removes the downtime by upgrading gradually. You take down a small batch of old instances, bring up the same number of new ones, wait for them to pass health checks, and repeat until the whole fleet is on the new version. Traffic shifts smoothly and the service stays available throughout — which is exactly why it's the default in Kubernetes. The catch is that during the roll, old and new versions serve requests *at the same time*, so both must be compatible with shared state, APIs and database schemas. Rollback is also slower than a switch-based strategy, because you have to roll the fleet *back* batch by batch rather than flipping instantly.

03

Blue-green and instant rollback

Blue-green deployment takes a different tack: instead of upgrading instances in place, you run two complete environments side by side. "Blue" is the current live version serving all traffic; "green" is the new version, fully deployed and tested but receiving no production traffic. When green is verified, you flip a router or load balancer so *all* traffic moves from blue to green at once.

The headline benefit is instant rollback. Because the old blue environment is still running, untouched and idle, recovering from a bad release is as simple as flipping traffic back — no redeploy, no waiting. You also get zero downtime and the ability to smoke-test green with real infrastructure before exposing it.

The costs are real. During the switch you're running two full environments, so you roughly double your infrastructure spend for that period. And because traffic moves all at once, blue-green doesn't limit blast radius the way a canary does — if green is broken in a way testing missed, everyone hits it the instant you flip (though you can flip straight back). The hardest part is usually stateful concerns: database migrations must work for both versions during the transition, since blue and green share the same data. Blue-green shines when you need zero downtime and the fastest possible rollback, and can afford the duplicate environment.

04

Canary and A/B testing

Canary deployment — named for the canary in a coal mine — is the most cautious strategy. You release the new version to a *small* slice of traffic first, perhaps 1% or 5%, while the overwhelming majority stay on the stable version. Then you watch: error rates, latency, business metrics. If the canary looks healthy, you progressively widen the slice — 5%, 25%, 50%, 100% — until the new version has fully taken over. If anything looks wrong, you pull the canary and only a tiny fraction of users were ever affected.

This gives the smallest blast radius of any strategy: a bad release is caught while it's hurting almost nobody. The price is machinery — you need fine-grained traffic splitting (often via a service mesh or ingress) and, crucially, good observability, because a canary is only as safe as your ability to detect that it's misbehaving.

A/B testing uses the same traffic-splitting mechanism but for a different purpose. Instead of routing a random small percentage to de-risk a rollout, A/B routes users by a specific attribute — region, device type, user cohort, or a deterministic random bucket — and compares how the variants perform. The goal is *learning*, typically a product or business question ("does the new checkout convert better?"), not just safe release. It's easy to conflate with canary because the plumbing overlaps, but the intent differs: canary asks "is this version *safe*?", A/B asks "is this version *better*?"

05

Choosing in practice

There's no universally correct strategy — there's the one that fits your constraints. A useful way to decide is to walk the four axes against your service's needs.

  • If you can tolerate a maintenance window and want minimal cost and complexity, recreate is honest and fine.
  • If you need zero downtime with modest infrastructure and your versions can coexist, rolling is the pragmatic default — which is why platforms ship it out of the box.
  • If you need zero downtime *and* instant rollback and can pay for a duplicate environment, blue-green buys you the fastest recovery.
  • If the release is risky and you have strong monitoring, canary gives you the smallest blast radius by exposing few users until you're confident.
  • If the question is which variant performs better rather than merely whether a release is safe, A/B is the tool.

In the real world these combine. A mature pipeline might use rolling updates day to day, promote major changes through a canary gated on automated metric checks, keep blue-green available for the riskiest releases, and run A/B experiments independently on top. The through-line is the same discipline every time: understand how the strategy shifts traffic, know where it lands on downtime, risk, rollback speed and cost, and pick deliberately rather than by default.

what to remember
01

Recreate: stop the old version, start the new — simplest and cheapest, but causes downtime.

02

Rolling: replace instances a few at a time, so there's no downtime but old and new run together briefly.

03

Blue-green: run two full environments and switch traffic all at once — instant rollback, but double the cost.

04

Canary: route a small percentage to the new version, watch metrics, then widen — smallest blast radius.

05

A/B testing: route users by attribute (region, cohort) to compare variants, not just to release safely.

06

The axes to weigh are downtime, risk, rollback speed and infrastructure cost.

check yourself

Quick quiz

Q1

Which strategy gives the fastest rollback?

Q2

How does a canary release limit risk?

follow the thread