Skip to content

Deployment Strategies โ€‹

๐Ÿ“ Context โ€‹

Once an artifact is built and tested, how it reaches production decides the blast radius of a bad release. The strategy is the difference between "every user hit the bug" and "2% of traffic hit it for ninety seconds, then we rolled back automatically."

This is the canonical home for rollout strategy. Cutover Planning applies these to a one-time migration; Reference Architectures shows them in the operational view; this page is the reusable decision surface.

๐Ÿ“‹ Decision Checklist: Which Strategy? โ€‹

  • [ ] Can the old and new versions run at the same time against the same data?
  • [ ] Is there spare capacity to run two versions (blue-green needs ~2ร— during cutover)?
  • [ ] Can you shift a fraction of traffic and measure it (canary needs routing + metrics)?
  • [ ] Is downtime acceptable, even briefly (recreate is simplest if yes)?
  • [ ] Do you need to decouple deploy from release (feature flags)?
%%{init: {'theme': 'neutral', 'themeVariables': {'fontSize': '14px'}}}%%
flowchart TD
    A[Is brief downtime acceptable?] -->|Yes| B[Recreate]
    A -->|No| C[Can old and new run together?]
    C -->|No| D[Resolve compatibility first]
    C -->|Yes| E[Can you measure a traffic slice?]
    E -->|No| F[Rolling or blue-green]
    E -->|Yes| G[Canary]
    F --> H[Add feature flags to decouple release]
    G --> H

๐ŸŽฏ The Strategies โ€‹

StrategyHow it worksRollbackCost / riskBest for
RecreateStop old, start newRedeploy old versionDowntime during swapDev/test, or apps that tolerate a maintenance window
RollingReplace instances batch by batchRoll the batches backTwo versions live mid-roll; needs back-compatDefault for stateless services on orchestrators
Blue-GreenStand up full new env, switch traffic at onceFlip traffic back to old~2ร— capacity during cutoverFast, clean cutover with instant rollback
CanaryRoute a small % to new, widen on healthShift traffic back to oldNeeds traffic routing + good metricsHigh-traffic, risk-sensitive services
Feature FlagsDeploy dark, release by toggling per cohortTurn the flag offFlag debt if not cleaned upDecoupling deploy from release; gradual exposure

The pairing that matters: canary (or blue-green) controls infrastructure risk; feature flags control product risk. They compose โ€” ship the code dark behind a flag via a canary deploy, then turn it on for 1% of users. Deploy โ‰  release.

๐Ÿงฉ Worked Scenario: Canary the Order Service โ€‹

The Order Service ships a rewritten pricing path. A bug here over-charges customers, so the team will not flip it on for everyone at once.

%%{init: {'theme': 'neutral', 'themeVariables': {'fontSize': '14px'}}}%%
flowchart LR
    NEW[New version live] --> C5[5 percent traffic]
    C5 --> M1{Error rate normal?}
    M1 -->|No| RB[Rollback to old]
    M1 -->|Yes| C25[25 percent traffic]
    C25 --> M2{Still healthy?}
    M2 -->|No| RB
    M2 -->|Yes| C100[100 percent]
1 ยท 5%
Route 5% of traffic to the new version. Bake for a fixed window and watch error rate and latency against the old version as the baseline.
2 ยท 25%
Healthy at 5%, widen to 25%. The blast radius of a missed bug is still a quarter of traffic, briefly โ€” not all of it.
3 ยท 100%
Metrics hold, promote to full. The old version stays warm until the new one is proven, so rollback is instant.
Auto-rollback
At any step, an error-rate breach shifts traffic back to the old version automatically โ€” no human in the loop at 2 a.m.

The numbers (illustrative โ€” set them from the customer's SLOs): steps 5% โ†’ 25% โ†’ 100%, a bake window of ~10 min per step, auto-rollback when error rate exceeds ~1% over the baseline. The point isn't the exact figures โ€” it's that they're defined and automated before the rollout, not decided live.

Say it like this

"We send 5% of traffic to the new version and compare its error rate to the old one. If it's clean, we widen to 25%, then 100%. If it degrades at any point, traffic shifts back automatically. The worst case is a small slice of users for a few minutes โ€” not an all-hands outage."

๐Ÿ‘๏ธ Audience Lens โ€‹

AudienceWhat they care about
EngineeringRollback speed, back-compat between versions, routing controls
ProductWhich cohort sees what, and the ability to dark-launch then release
Customer / OpsNo surprise outages; degraded releases self-heal

โš ๏ธ Gotchas โ€‹

  • Canary without good metrics is just a slow full rollout โ€” you need a baseline to compare against
  • Rolling and canary require backward compatibility โ€” old and new run together, including the database schema
  • Blue-green forgets the database โ€” duplicating compute is easy, duplicating stateful data is the hard part
  • Feature-flag debt โ€” flags that never get cleaned up become permanent hidden branches
  • Treating deploy as release โ€” shipping code is not the same as exposing it to users
  • No defined rollback trigger โ€” "we'll watch it" is not an automated threshold

๐Ÿ“š Further reading โ€‹

Canonical descriptions of the rollout patterns on this page:

Built as a public field guide for practical Solutions Engineering and Architecture work.