stackbook.io
🔍
← Back to Syllabus
Day 5Level 3 — Operating Reliably

Safe Deployments and Rollbacks

Learn: 30 minMap: 25 minDesign: 45 min

Core Concepts (5)

  • 1.Most outages follow a change
  • 2.Small, frequent releases are safer than large rare ones
  • 3.Canary releases expose a small slice before everyone
  • 4.Feature flags separate deploying from releasing
  • 5.A rollback you have never tried is only a hope

Map to Your Experience

Think of the scariest release you have been part of. What would have made it boring?

Design Brief: Design a Safe Release Pipeline

Learn

Studies of incidents repeatedly find that most outages begin with a change: a deployment, a configuration edit, or a migration. This makes release practice one of the highest leverage reliability investments. The goal is to make changes small, observable, and reversible.

Small releases are safer because the cause of a problem is easy to find when only a few changes shipped. Large batches hide the culprit and tempt teams to delay, which makes the next batch larger still. Aim for frequent, boring releases.

A canary release sends the new version to a small share of traffic, perhaps one percent, and compares its error rate and latency against the old version. If metrics stay healthy, the rollout widens in stages. If they degrade, automation halts and reverts. Define the comparison metrics and thresholds beforehand, and tie them to your SLIs. Blue green deployment keeps two full environments and switches traffic between them, which allows instant reversal at higher infrastructure cost.

Feature flags separate deploying code from releasing behaviour. Code can ship turned off, then be enabled for staff, then a percentage of users, with a switch that disables it in seconds without a new deployment. Treat flags as debt: remove them once a feature is stable, and test both states while they exist.

Data changes are the hard part of rollback. Use the expand and contract approach: first add the new column or table in a way old code ignores, deploy code that writes both, backfill, switch reads, and only later remove the old structure. Every step is compatible with the step before it, so you can stop or reverse at any point. Finally, practise rollbacks regularly. A rollback that has never been rehearsed often fails when it is most needed.

Map

Write the steps of your current release process for a service you know. Mark the step where a bad change would first be noticed, how long that takes, and how you would reverse it.

Design

Design the pipeline for the payments service: stages with traffic percentages, the metrics and thresholds at each gate, the automatic rollback rule, the flag strategy, and the expand and contract sequence for one schema change. Keep your answer concrete: name real numbers, owners, and examples wherever you can, and note any assumption you had to make so a reviewer can challenge it.

Requirements

  • •Describe the rollout stages and their gates
  • •Define automatic rollback triggers
  • •Explain how database changes are released safely

Constraints

  • •Multiple releases per day
  • •Database schema is shared with a reporting job

Must Cover

canary-stagesrollback-triggersfeature-flagsschema-migration

Trade-off Axis

release speed vs risk

Competencies Advanced

reliability ops → L4economics evolution → L3

Ready to Design?

Open this day in the Design Studio. The studio follows this track: its days, concepts, patterns and trade-offs are loaded, and you keep one design across the whole track.

Open in Studio →