Progressive delivery: canary releases decided by automated analysis
Tests catch many defects, but some only appear with real traffic, real data and real load. Progressive delivery accepts that and limits the damage: a new version meets a small share of users first, and an automated judge decides whether it may meet more.
Contents
Key facts
- A canary release routes a small, increasing share of traffic to a new version while the stable version serves the rest.
- Argo Rollouts and Flagger are Kubernetes controllers that automate canary and blue-green rollouts with metric-based analysis.
- Analysis should compare the canary with the current stable version under the same conditions, not only with fixed thresholds.
- Both versions run simultaneously, so database changes must be compatible with both during the rollout.
Why all-at-once releases hurt
With a rolling update, every pod is replaced in a few minutes and all traffic reaches the new version. If it has a defect that tests missed — a slow query on production data, a misread configuration value, a dependency that behaves differently under load — every user is affected before anyone looks at a dashboard.
Rollback then depends on people: someone must notice, decide, and remember how to roll back under pressure. Progressive delivery replaces that chain with a process defined in advance. Exposure grows only while measurements stay healthy, and rollback is the default response when they do not.
The mechanics of a canary
The new version is deployed next to the stable one. A traffic router — a service mesh, an ingress controller or a load balancer with weighted routing — sends a small percentage of requests to it. After a pause long enough to collect meaningful data, an analysis step evaluates metrics. If they pass, the weight increases; if they fail, all traffic returns to stable.
| Strategy | How traffic moves | Best for |
|---|---|---|
| Canary | Gradually, by percentage | Services with steady traffic and good metrics |
| Blue-green | All at once, with instant switch-back | Changes that cannot run side by side in small shares |
| Feature flags | By user or cohort inside one deployment | Product changes that need targeted exposure |
The strategies combine well. A canary protects against technical regressions in the deployment; feature flags then control which users see new behaviour once the code is safely deployed.
What to measure and how to judge
Analysis needs metrics that reflect user experience and can be separated by version: request success rate, latency percentiles and saturation signals such as CPU throttling or queue depth. Add business signals where they exist — successful checkouts, completed sign-ups — because some defects only show there.
- Compare with baseline — evaluate the canary against stable pods over the same window, so a traffic spike or a downstream incident does not fail an innocent release.
- Require enough data — a step with ten requests cannot detect a 1% error rate. Size pauses to the traffic volume or require a minimum request count.
- Use guardrails and targets — absolute limits (error rate never above the SLO) plus relative ones (no worse than baseline by more than a margin).
- Fail closed on missing data — if metrics cannot be queried, the analysis should fail, not pass.
Making two versions coexist
During a canary, old and new versions share the same database, caches and message queues. Anything one version writes, the other must be able to read. Schema changes therefore follow the expand/contract pattern: add compatible structures first, deploy code that uses them, and remove old structures only after the rollout is complete and rollback is no longer needed.
The same applies to messages and cache entries. Version them, make consumers tolerant of unknown fields, and avoid changing the meaning of an existing field in the same release that starts using it.
Operating progressive delivery
Treat rollout definitions and analysis templates as code, reviewed alongside the service. Make the current state of each rollout visible in chat or the deployment dashboard, and record every automatic rollback with the metric that triggered it. Those records are some of the most useful inputs to post-incident reviews and to improving tests.
Allow manual intervention, but make it deliberate: promoting a release against a failed analysis should require a reason that is logged. Over time, measure change failure rate and time to restore; progressive delivery should lower the impact of failures even if their number stays the same.
Configuration and infrastructure changes
Many production incidents are caused not by code releases but by configuration changes: a feature flag flipped for everyone, a timeout reduced, a new firewall rule. These changes often bypass the careful rollout that code receives, because they are applied through a console or a single command.
The same principles apply to them. Store configuration in version control, roll it out in stages — one region, one cluster or a percentage of users first — and attach the same health analysis used for code. Feature-flag systems usually support percentage rollouts and targeting; use them for risky changes instead of switching a flag for all users at once.
Infrastructure changes such as node image updates or database parameter changes can follow a canary pattern too: apply them to one node or one replica, observe, then continue. The automation differs, but the discipline — limited exposure, measured judgement, quick reversal — is identical.
Keep a single timeline of all changes — code deployments, configuration updates, feature-flag changes and infrastructure work — next to your service-level dashboards. When a metric moves, the first question is always what changed, and a shared change log answers it in seconds instead of a round of messages across teams.
Worked example: a canary that saved a release
A search service handles about 400 requests per second. Its rollout uses steps of 5%, 25%, 50% and 100%, with five-minute pauses and analysis after each step.
- Version 2.14 introduces a new ranking query. At 5%, the canary receives around 6,000 requests during the pause.
- Error rate is identical to stable, but p95 latency for the canary is 2.3 times the baseline because the new query misses an index on production data.
- The relative latency check fails. Traffic returns to stable automatically within seconds; about 5% of requests saw slower responses for a few minutes.
- The team adds the index through an expand step, adds a performance test with a production-like data volume, and releases 2.15, which passes all steps.
Without the canary, every user would have experienced the slowdown, and the rollback would have depended on someone noticing it.
Common pitfalls
- Canary steps too short or too small to detect the problems they are meant to catch.
- Fixed thresholds only, so unrelated incidents fail good releases and slow regressions pass.
- Analysis that passes when metrics are missing.
- Database or message changes that only the new version understands.
- Manual promotion without recorded reasons.
- Measuring technical metrics only and missing business-level failures.
FAQ
Do we need a service mesh?
No. Ingress controllers and many load balancers support weighted routing. A mesh adds finer control and per-version metrics but is not required.
What about stateful services?
Canaries are hardest for stateful components. Blue-green with replicated data, or careful feature flags within one deployment, are often better choices.
How many steps should a rollout have?
Enough to limit exposure at the first sign of trouble; three to five steps are common. Tune them to traffic volume and risk.
Checklist
- Weighted traffic routing per version.
- Analysis comparing canary with baseline, plus absolute guardrails.
- Minimum sample size per step; failure on missing data.
- Automatic rollback with the trigger recorded.
- Expand/contract for schema, message and cache changes.
- Change failure rate and time to restore tracked over time.