Definition
What it is
A canary deployment puts the new version in front of real users, not test users, but only a fraction of them: typically 1% to 5%. The old version keeps serving the rest. Metrics — error rate, latency, business KPIs — are compared between the two cohorts. If the new version is within tolerance, the slice widens: 5%, 10%, 25%, 50%, 100%. If not, traffic returns to the old version in seconds.
The technique is orthogonal to blue/green. Blue/green flips 100% of traffic at once; canary ramps slowly. Blue/green needs a full duplicate environment; canary needs a router that can split traffic by percentage or by user cohort.
Why it matters
A full rollout of a broken version touches every user at once. A canary rollout of the same version touches a small cohort, and the rest of the users never see the bug. The cost of a mistake drops from "all users, minutes to hours" to "few users, seconds". The organisational consequence is larger than the technical one: teams that can afford to be wrong can ship more often.
Rolling out progressively
Slice 1 — 1% of traffic: internal users first.
Slice 2 — 5% of traffic: quiet cohort, low-risk regions.
Slice 3 — 25% of traffic: two or three regions, peak hours excluded.
Slice 4 — 50% of traffic: full region set.
Slice 5 — 100% of traffic: canary becomes the stable.
At every step: automated comparison against baseline; rollback on regression.
Blue/green vs canary vs feature flag
Aspect | Blue/green | Canary | Feature flag |
|---|---|---|---|
Traffic shift | 100% at once | Progressive, by slice | By user segment |
Rollback unit | Environment switch | Routing rule | Flag value |
Metrics comparison | Manual, before flip | Automated, per slice | Per cohort |
Complexity | Duplicate environment | Traffic router + metrics | Flag service |
Best for | Fast rollback | Detecting regressions | Product experiments |
The deployment flow
graph LR A[Deploy v2] --> B[Route 1% traffic] B --> C[Compare metrics] C -->|OK| D[Widen to 5%] C -->|Regression| R[Roll back] D --> E[Widen to 25%] E --> F[Widen to 100%] F --> G[v2 becomes stable] R --> H[v1 keeps serving] style A fill:#E8F5E9 style G fill:#E8F5E9 style R fill:#FFEBEE
How to adopt one
Adopting canary in a real system
Split traffic
By percentage at the load balancer, or by user cohort at the edge. Both work; pick one and keep it stable.
Automate the comparison
Manual comparison does not scale. Netflix built Kayenta for this and open-sourced it in 2018.
Define a baseline
The old version, at the same time of day, in the same regions. Otherwise you compare apples to time zones.
Rollback in under thirty seconds
If rollback takes ten minutes, canary is theatre. The routing change must be instant.
Origin
In 1911, John Scott Haldane proposed using small birds as early-warning detectors in coal mines. Canaries have a faster metabolism than humans and are more sensitive to carbon monoxide; at the first trace of gas, the bird stops singing and collapses, giving miners time to evacuate. The practice spread through British mining and was only retired in 1986, when electronic detectors replaced the birds.
Software borrowed the metaphor in the 2010s. Danilo Sato and Martin Fowler formalised the Canary Release pattern in 2014. Netflix released Kayenta, an automated canary analysis tool, in 2018. The metaphor survives because it is exact: a small population absorbs the risk first, so the large population never sees it.
A canary release is a technique that reduces the risk of introducing a new software version in production by slowly rolling out the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody.
— Danilo Sato, *CanaryRelease*, martinfowler.com, 25 June 2014
Evidence
FAQ
- Canary vs blue/green?
Blue/green flips 100% at once and rolls back by switching environments. Canary ramps progressively and rolls back by re-routing traffic.
- How much traffic do I need?
Enough that 1% is a meaningful sample. In practice: thousands of requests per minute, or a system where a single user failure is measurable.
- Is canary only for large companies?
No. Any deployment with a router that can split traffic and a metrics endpoint canary the same way; the tooling differs, the pattern does not.
- What is automated canary analysis?
A program that compares metrics between the canary cohort and the baseline and decides whether to widen or roll back. Kayenta is the reference implementation.
Connections
- blue-green-deployment
- feature-flag
- rollback
- deployment
- observability
Sato, D. (2014). CanaryRelease. https://martinfowler.com/bliki/CanaryRelease.html
Netflix Technology Blog (2018). Automated Canary Analysis at Netflix with Kayenta. https://netflixtechblog.com/automated-canary-analysis-at-netflix-with-kayenta-3260bc7acc69
Wikipedia (2024). Canary release. https://en.wikipedia.org/wiki/Feature_toggle#Canary_release
Etymology
Origin: metaphor
canary(noun): small yellow bird, from Latin canaria insula, the Canary Islands
Semantic network
● broader ● narrower ● related
Broader
software-deliverydeployment-patterns
Related
- Blue/green deployment
feature-flag- Rollback
deployment- Observability
kayenta
Used in the garden
Sources
Sato, D. (2014). CanaryRelease. https://martinfowler.com/bliki/CanaryRelease.html
Netflix Technology Blog (2018). Automated Canary Analysis at Netflix with Kayenta. https://netflixtechblog.com/automated-canary-analysis-at-netflix-with-kayenta-3260bc7acc69
Wikipedia (2024). Canary release. https://en.wikipedia.org/wiki/Feature_toggle#Canary_release