Skip to the guide

Deployments: blue-green, canary and feature flags

IntermediateConcept3 pages

Most outages start with a change: a new release, a config push, a schema migration. Google's SRE book puts it at roughly 70%. Interviewers want to hear how a bad release reaches as few users as possible, how fast you can undo it, and what happens to the database while two versions run at once.

New card machines in a chain of shops

A chain of 200 shops is replacing its card machines. Head office tries one shop first and watches for a day: are payments failing, are queues longer? Then 10 shops, then 50, then all of them. In each shop, the old machine stays plugged in under the counter for a week, so staff can swap back in a minute. And the new machines have a "pay with your phone" button that head office keeps switched off, then turns on remotely, shop by shop.

  • head office → the rollout tool, such as Argo Rollouts, and the flag service
  • the shops → slices of traffic or servers, and their customers → users
  • one shop first, then more → a canary release
  • the old machine under the counter → blue-green: the old version kept running, ready to take traffic back at once
  • the button switched on from head office → a feature flag: code that's shipped but not yet released
  • watching failed payments and queues → the metrics that decide whether to go on