5.1 · Why deploy strategy matters
Definition. A deployment strategy is the orchestrated process by which a new version of software replaces or coexists with the previous version in a production environment. It governs the order of host updates, the routing of traffic, the gating signals that promote or abort, and the path back to safety if something goes wrong.
| Term | Definition | Owner |
|---|---|---|
| Deploy | The artefact (image, binary, bundle) is installed on production infrastructure. | Pipeline / GitOps controller. |
| Release | The new behaviour becomes visible to (some) users. | Traffic router, feature flag, store rollout. |
| Rollout | The choreography of moving from 0% → 100% release. | Progressive-delivery controller (Argo Rollouts, Flagger). |
| Rollback | Reverting to the previous known-good state. | Automatic on SLO breach, or human-triggered. |
5.2 · The strategy catalogue
| Strategy | Mechanism | Infra cost | Blast radius | Rollback | Typical use |
|---|---|---|---|---|---|
| Recreate | Stop v1, start v2. | 1× | 100% during gap | Re-deploy v1 | Dev, batch, schema-locked apps. |
| Rolling | Replace instances in waves. | ~1.1× | Wave-sized | Roll forward / pause | K8s default; stateless services. |
| Blue-Green | Run v2 alongside v1; flip LB. | 2× | 0% or 100% (flip) | Flip back | Critical workloads needing instant revert. |
| Canary | Route a small % of traffic to v2; widen on green metrics. | 1.05–1.2× | Canary slice only | Drop weight to 0 | User-facing services with SLOs. |
| Linear / Stepped | Canary with fixed steps (10, 25, 50, 100%). | 1.1× | Step-sized | Drop weight | Predictable, audit-friendly canaries (AWS CodeDeploy). |
| A/B | Route by user attribute (cohort, geo) to compare variants. | ~1.2× | Cohort-sized | Turn off variant | Product experiments, not safety. |
| Shadow / Mirror | Copy live requests to v2; discard responses. | ~2× | 0% user-visible | Stop mirror | Replatform, perf validation. |
| Dark Launch | Code deployed, behaviour hidden behind a flag. | 1× | 0% until flip | Disable flag | Pre-launch warm-up, schema seeding. |
| Ring-based | Cohorts of clusters/users updated in concentric rings. | 1.1× | Ring-sized | Halt at ring | Fleet-wide SaaS (M365, Windows). |
| Multi-variant Canary | Several candidate versions canaried in parallel. | 1.3–2× | Slice-sized | Pick winner | ML model rollouts, perf bake-offs. |
5.3 · Rolling deployments
Definition. A rolling deployment replaces a service's instances in successive waves, draining and updating a controlled number at a time while the rest continue to serve traffic. It is the Kubernetes Deployment default.
- maxSurge — extra pods above the desired count that may exist during the roll (e.g.
25%). Higher = faster, more capacity needed. - maxUnavailable — pods that may be down at once (e.g.
0for zero-downtime services on autoscaled nodes). - Readiness probes — gate traffic to a pod only after the new version reports healthy.
- minReadySeconds — soak the pod for N seconds before counting it ready (catches slow-start crashes).
- PodDisruptionBudget — caps simultaneous voluntary disruptions during the roll.
# Kubernetes Deployment — safe rolling defaults
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 0
minReadySeconds: 15
progressDeadlineSeconds: 600 # auto-fail if stuck
5.4 · Blue-Green
Definition. Two complete production stacks (blue = current, green = candidate) run side by side. A load-balancer, DNS record, or service-selector switch promotes green to live in one atomic flip; the previous stack remains warm for instant rollback.
- Pros. Instant rollback by flipping back; full validation against production-grade infra; no two versions on a single host.
- Cons. Doubled capacity cost during the cutover window; database migrations and stateful systems complicate the symmetry.
- Implementations. AWS Elastic Beanstalk swap-URL, AWS CodeDeploy ECS/Lambda blue-green, Azure Deployment Slots, Cloudflare DNS swap, K8s Service selector flip.
5.5 · Canary
Definition. A canary deployment routes a small fraction of live traffic to a new version, observes SLO-grade signals (latency, error rate, saturation, business KPIs), and progressively widens — or rolls back — based on automated analysis.
| Phase | Weight | Action | Gate |
|---|---|---|---|
| Bake | 1–5% | Warm caches, JIT, connection pools | No 5xx in 2 min |
| Step 1 | 10% | Compare error/latency vs baseline | p99 within 10% |
| Step 2 | 25% | Watch business metric (orders/min) | Δ within 1σ |
| Step 3 | 50% | Confirm steady state | SLO budget intact |
| Promote | 100% | Scale down old; flip stable label | — |
# Argo Rollouts — analysis-gated canary
spec:
strategy:
canary:
steps:
- setWeight: 10
- pause: { duration: 2m }
- analysis:
templates: [{ templateName: success-rate }]
- setWeight: 50
- pause: { duration: 10m }
---
kind: AnalysisTemplate
metrics:
- name: error-rate
successCondition: result[0] < 0.01
provider:
prometheus:
query: sum(rate(http_requests_total{status=~"5..",svc="checkout-canary"}[2m]))
/ sum(rate(http_requests_total{svc="checkout-canary"}[2m]))
- Argo Rollouts (Intuit, CNCF Incubating) —
RolloutCRD replacesDeployment; integrates with Istio, Linkerd, NGINX, ALB, AppMesh, SMI. - Flagger (Flux project, CNCF) — Operator-driven canaries with Prometheus, Datadog, Dynatrace, NewRelic, CloudWatch, Stackdriver, Graphite as metric providers.
- Spinnaker Kayenta — Netflix's Automated Canary Analysis (ACA) service, scoring via Mann-Whitney U tests.
5.6 · Shadow / Traffic Mirroring
Definition. Shadow deployment forwards a copy of live production requests to a candidate service, discarding its responses. The user sees only the production answer; the candidate is observed for crashes, latency, and divergence.
- Service mesh primitives. Istio
mirror/mirrorPercentage, Linkerd traffic split + tap, Envoyrequest_mirror_policies, NGINXmirror. - Best for. Replatform (Java → Go), datastore swap (MySQL → Postgres), model A/B comparison, infrastructure migrations.
- Hazards. Side effects! If the candidate writes to real databases, sends emails, or charges cards, shadow becomes not-shadow. Always route writes to a sandbox or use idempotency keys with a sink.
5.7 · Ring-based deployment
Definition. Pioneered at scale by Microsoft for Office 365 and Windows (and documented in the Azure Well-Architected Framework, 2018+), ring-based deployment treats the fleet as concentric cohorts: each ring proves the build before the next opens. A bad change is contained at the smallest ring affected.
| Ring | Cohort | Soak | Purpose |
|---|---|---|---|
| Ring 0 · Canary | Dogfood / internal tenants | 1–4 hours | Catch crashes, smoke |
| Ring 1 · Early Adopter | Small external preview tenants | 1–3 days | Real-traffic regressions |
| Ring 2 · Broad | ~25% of fleet | 3–7 days | Scale & long-tail bugs |
| Ring 3 · Public | Remaining 100% | Steady state | GA |
5.8 · The 2026 deployment-tooling landscape
| Tool | Vendor | Best at |
|---|---|---|
| Argo Rollouts | CNCF (Intuit) | K8s canary/blue-green with rich analysis. |
| Flagger | CNCF (Flux) | GitOps-native progressive delivery on K8s. |
| Spinnaker | CDF (Netflix) | Multi-cloud pipelines, Kayenta ACA. |
| Harness CD | Harness | AI-assisted verification, hosted progressive delivery. |
| Codefresh | Octopus / Codefresh | GitOps + Argo Rollouts as a managed service. |
| Octopus Deploy | Octopus | Windows / .NET / on-prem heterogeneous fleets. |
| AWS CodeDeploy | AWS | EC2, Lambda, ECS canary/linear/blue-green. |
| Azure Deployment Slots | Azure | App Service blue-green with slot swap. |
| Google Cloud Deploy | GCP | GKE/Cloud Run delivery pipelines with verification. |
| Kubernetes Deployment | K8s core | Built-in rolling updates. |
5.9 · Database deployments
The single hardest part of any deployment strategy is the part that holds state. Schemas cannot be canaried trivially; you have one production database and it must serve both old and new code during the rollout.
- Expand-and-contract (parallel change). Add the new column/table (expand) → backfill → switch reads → remove old (contract). Each step is backwards-compatible in isolation.
- Dual writes. Application writes to both old and new schema during the migration window; reconciliation job verifies parity before flipping reads.
- Online schema change. Tools that mutate large tables without locking —
gh-ost(GitHub, MySQL),pt-online-schema-change(Percona Toolkit), Vitess online DDL, Atlas (Ariga), Spanner schema updates (online by design). - Versioned migration runners. Liquibase, Flyway, Sqitch, Alembic, Prisma Migrate, TypeORM migrations, golang-migrate — track applied changes via a metadata table.
- Branching databases. Neon, PlanetScale, Xata — per-branch ephemeral DBs for CI; merge as a deploy primitive.
5.10 · Mobile & desktop releases
| Platform | Staged rollout | Review window | OTA / hotfix |
|---|---|---|---|
| Google Play (Android) | 1% → 5% → 10% → 20% → 50% → 100% over days | Hours to a day | In-app updates API, Expo OTA (React Native), CodePush (deprecated 2024). |
| App Store Connect (iOS/macOS) | Phased Release — 7-day automatic schedule | 24–48 h typical | Expo OTA for JS bundles; native code requires submission. |
| Microsoft Store | Package Flights to ring cohorts | Hours | MSIX delta updates. |
| Electron / Tauri desktop | electron-updater channels (alpha/beta/stable), Squirrel | None | Auto-update from signed feed. |
| Steam | Branches (default, beta, internal) | None | Delta patches via Steampipe. |
- Force-update. Ship a minimum-supported-version endpoint; clients below it show a blocking update screen — critical for breaking API changes.
- Server-driven UI. Move screen layout to a configuration service so design changes ship without a store submission.
- Halt rollout. Both Play and App Store let you pause a staged rollout if crash-free-sessions drops.
5.11 · Rollback playbook
- Define automatic rollback triggers before the deploy — SLO error-budget burn, p99 latency > threshold, business-metric drop > X%.
- Make rollback the same primitive as deploy. If rollback is a different script, it will fail at 03:00. GitOps revert-PR is the gold standard.
- Keep the previous version warm for at least one full release cycle (blue stack standby, previous ReplicaSet retained, last image pinned).
- Prefer flag flip to redeploy when the change is flag-gated — seconds vs minutes.
- Database changes follow the contract, not the deploy. Roll back code; data stays expanded until the next planned contract.
- Post-incident. Every rollback yields a learning ticket and an updated playbook (see Ch 15).
Cross-references
- Ch 04 — the pipeline that hands the artefact to the strategy.
- Ch 06 — feature flags as the cleanest deploy/release separator.
- Ch 07 — GitOps controllers (Argo CD, Flux) executing the rollout.
- Ch 13 — SLO signals that gate canary promotion.
- Ch 15 — rollback as the first action of incident response.