โ† Back to microservices patterns map
๐Ÿฆ
Microservices Pattern

Canary Deployment

Release to a small percentage of traffic, monitor, then gradually increase.

deploy

Detailed Description

Canaries reduce release risk by exposing new code to a small group first.

Automated canaries should watch error rate, latency, and business metrics.

Roll out in traffic steps (for example 1% -> 5% -> 25% -> 50% -> 100%) with explicit gates.

Define rollback thresholds in advance: 5xx spike, p95/p99 latency regression, or checkout/payment drop.

Canary is a release-safety strategy, not a product experiment strategy.

Visual Diagram

100 users total:
  5%  โ†’ v2 (canary ๐Ÿฆ) โ€” monitor closely
  95% โ†’ v1 (stable)

  metrics OK? โ†’ increase to 25% โ†’ 50% โ†’ 100%
  metrics bad? โ†’ rollback 5% โ†’ 0% instantly

Tradeoffs

Pros

Real-user validation with limited blast radius

Cons

Needs metrics and traffic splitting

Examples: Argo Rollouts, Flagger, Spinnaker, Istio weights