Operations Reviewed

Safe rollouts and canarying

The SRE Workbook defines canarying as a partial, time-limited deployment of a change and its evaluation: the part that gets the change is the canary, the rest is the control, and comparing them decides whether to continue. It matters because 68% of outage triggers in Google’s postmortem sample were binary (37%) or configuration (31%) pushes, so rolling out in stages and rolling back automatically when the two diverge costs a bad change a small slice of the error budget instead of all of it.

On this page
  1. Canary and control
  2. Worked example
  3. Stages, size and bake time
  4. Automatic rollback
  5. Where sources differ
  6. Changes that can’t simply roll back
  7. Configuration and feature flags
  8. Rollout plan template

Canary and control

The SRE Workbook defines canarying as a partial, time-limited deployment of a change and its evaluation: the part that gets the change is the canary, the rest is the control, and comparing them decides whether to continue. It needs three things: a way to deploy to a subset of the service, an evaluation that judges the canary good or bad, and a release process that acts on the result.

Worked example

What a canary saves, and why per-version metrics matter

A release fails 20% of the requests it serves. The service has a 99.9% SLO over 30 days and the Workbook’s fast-burn page: 14.4× over 1 hour and 5 minutes. The release goes to a 5% canary.

  1. Service-wide error ratio during the canary:20% × 5% = 1%
  2. The service-wide fast page needs more than 14.4 × 0.1% = 1.44%, so it never fires. The 6× page over 6 hours needs 0.6%:1% > 0.6%, so it fires after 0.6% ÷ 1% × 6 h = 3h 36m
  3. The fast page evaluated on the canary’s own requests sees 20%:fires after 1.44% ÷ 20% × 1 h = 4m 19s
  4. Add 10m to roll back. Budget spent in those 14m 19s:canary: 1% × 14m 19s ÷ 43m 12s = 0.331%; everywhere at once: 6.63%

Caught on its own metrics, the canary costs 0.331% of the month’s budget where a full deployment would cost 6.63%. Judged only on service-wide numbers, it runs until the 6× page fires 3h 36m in and costs 5.23%, nearly as much as the full deployment caught within minutes.

Stages, size and bake time

Google’s SRE book says non-emergency rollouts must proceed in stages, of both binaries and configuration, with stages in different geographies to expose differences in daily traffic patterns and traffic mix. AWS’s published pipeline is a concrete version:

Size and duration trade against release speed. The Workbook notes that a team releasing many times a day cannot run week-long canaries, that performance defects often appear only under peak load, and that the higher the request rate, the sooner a canary has a representative sample. Use the record of past canaries to tune stages rather than worst-case guesses.

Automatic rollback

Changes that can’t simply roll back

A rollback is only safe if the old version can run alongside the new one and read anything the new one wrote. Data formats, protocols and schemas break this. AWS’s answer is a two-phase deployment:

  1. Prepare: deploy a version that can read the new format but still writes the old one. Confirm every instance has it.
  2. Bake for long enough, typically a few days, that you will not need to roll back past it.
  3. Activate: deploy the version that writes the new format. Rolling it back is safe because the prepared version reads both.
  4. Backfill old data before removing support for the old format.

Readers go before writers when rolling forward, writers before readers when rolling back. Test it: deploy to about half the fleet, then everywhere, then roll back the same way, checking for errors at each step.

Configuration and feature flags

Configuration pushes cause almost as many outages as code, so they need the same stages. The SRE book’s advice is to fail sanely: validate new configuration, alert on implausible input such as a file much smaller than the last one, and keep running on the previous configuration rather than accept it. Its examples include an empty file that made Google’s DNS answer NXDOMAIN for six minutes, and a single “/” that marked the whole web as malware.

Feature flags separate deploying code from turning features on, so one feature can be switched off without rolling back the binary. Roll flags out in stages like anything else, give them owners, and remove them when the launch is finished. Record the flag states each request ran with, so a problem that appears only with a particular combination of flags can be found.

Rollout plan template

For risky changes, or as the default for a pipeline. The stage values come from the AWS pipeline above; they are starting points, not standards.

Change:        [what, ticket, owner]   Type: binary / config / flag / schema
Rollback:      [command or flag]; tested on [date]; safe after data written? [yes/how]
Compatibility: old and new versions can run side by side and read each
               other's data [yes / two-phase: prepare deployed on ...]
Signals:       [SLIs] broken down by version: canary vs control
Abort if:      canary error ratio > [x] or latency SLI below [y], or any page
               fires; roll back first, diagnose afterwards
Stages:        1 instance   bake ≥ 1h  and ≥ [n] requests
               [5%]         bake ≥ [h]
               one zone / region / cell at a time, [33%] per batch
               rest of fleet in waves of increasing size
Blockers:      no start during an incident, a change freeze or a spent error
               budget; inside [hours], not before weekends or holidays
Watch:         [person or automated alarm]; on-call told: [yes]

Sources: Google, The Site Reliability Workbook, ch. 16 “Canarying Releases” and appendix C “Results of Postmortem Analysis”; Site Reliability Engineering, 1st ed., appendix B “A Collection of Best Practices for Production Services”; Site Reliability Engineering, 2nd ed. (2026), ch. 14 “Testing” (“Client-Focused Change Supervision”) and ch. 17 “Designing for Resilience” (“Change Supervision”); Clare Liguori, Automating safe, hands-off deployments and Sandeep Pokkunuri, Ensuring rollback safety during deployments (Amazon Builders’ Library); Charity Majors, Liz Fong-Jones and George Miranda, Observability Engineering, 2nd ed. (2026), ch. 1 “What Is Observability?” (comparing by flag), ch. 9 “Observability-Driven Development” (rollbacks, single changes), ch. 24 “Systems Thinking for Software Delivery” and ch. 28 “The Organizational Shift” (deploy-day rules).