Skip to content

Lesson 8 of 9 · 27m

Breaking-Change Rollout, Brownouts, and Rollback

Use progressive enforcement, brownout windows, feature flags, rollback criteria, and emergency controls to reduce cutoff-day blast radius.

The traditional API sunset ceremony is simple: flip a switch at midnight, watch error graphs, and discover which customers never read email. Progressive enforcement is less dramatic and much more honest. You test whether the organization can tolerate the break, expose remaining dependency in controlled windows, and preserve the ability to stop when evidence contradicts the plan.

Separate deployment from enforcement

Version removal should be controlled independently from code deployment:

features:
  invoices_v1:
    enabled: true
    brownout_windows:
      - starts_at: "2026-01-12T15:00:00Z"
        duration_minutes: 30
    sunset_at: "2026-01-31T23:59:59Z"

This lets you ship the retirement mechanism early, test it internally, and change enforcement without an emergency deploy. Feature flags are operational controls, not a substitute for migration.

Brownouts create evidence

A brownout is a planned period when the deprecated behavior fails. It exposes forgotten batch jobs, mobile versions, vendor integrations, and unofficial scripts while recovery is still possible:

HTTP/2 410 Gone
content-type: application/problem+json

{"type":"https://docs.acme.dev/errors/invoices-v1-sunset","title":"Invoices API v1 is unavailable","migration":"https://docs.acme.dev/migrations/invoices-v2"}

Do not make brownouts random unless chaos is your actual communication strategy. Publish windows, start short, lengthen them, and monitor support tickets as well as request metrics.

Define rollback criteria before enforcement

Rollback is not failure; it is risk control. Decide what evidence pauses or reverses enforcement:

pause if:
- unknown-owner traffic exceeds 1% of baseline revenue-generating calls
- a contracted exception customer was missed
- terminal error responses are malformed or mis-cached
- migration tooling has a confirmed defect affecting multiple customers

Assign one decision owner. During a brownout is the wrong time to discover that product, engineering, support, and legal all believe someone else can approve an extension.

Enforce progressively by cohort when needed

Not every API can cleanly flip globally. You can enforce first for new accounts, then low-risk accounts, then general traffic, with explicit exceptions. Be careful: cohort enforcement adds complexity and can feel arbitrary if not documented. Explain the rule and the exception process.

if not feature_enabled("invoices_v1", account):
    raise SunsetProblem(migration_url=INVOICES_V2_MIGRATION)

Field notes

  • A brownout during your customer's own peak business window is self-inflicted harm. Learn usage seasonality first.
  • Returning generic 404 during sunset destroys diagnostic value; use a deliberate terminal response where possible.
  • Record every pause and extension in the migration register so the next team inherits facts, not folklore.

Was this lesson helpful?

Sign in to rate