Blue-green and canary releases

Cloud, deploys and infrastructure Mid-level Python 3.13+ PostgreSQL 17+ Reviewed By Best Latest Apps

Order the steps

Order a canary release.

  • Promote to 100% and retire the old version
  • Deploy the new version to a small canary group
  • Send 1% of traffic to it
  • Increase to 10%, then 50%

Choose an answer, then open Show answer below to check it.

Show answer

Answer: B C D A

  1. Deploy the new version to a small canary group Old version keeps most traffic.
  2. Send 1% of traffic to it Compare errors and latency with the baseline.
  3. Increase to 10%, then 50% If metrics stay healthy.
  4. Promote to 100% and retire the old version Or roll back automatically on regression.

30-second answer

Blue-green runs the new version beside the old and switches all traffic at once, with instant rollback by switching back; it doubles capacity during the switch. A canary sends a small share of traffic (1%, then 10%, 50%) to the new version and compares its error rate and latency with the old before continuing, so a bad release hurts few users. Both need backward-compatible database changes, because old and new code share the data.

Practise saying it · 30 s. No recording, just a timer

Safer releases.

Say your answer out loud, then check which of these points you covered:

  • Blue-green: switch, instant rollback
  • Canary: small share first
  • Automated analysis
  • Compatible schema

Deep dive

Automate canary analysis and rollback on SLO regressions.

Route canaries by user or region for consistency.

Feature flags separate deploying code from releasing features.

Watch business metrics (checkouts) as well as errors.

Common mistakes

  • A canary too small or too short to see anything.
  • Schema changes that break the old version.
  • Manual rollbacks that take 30 minutes.

Senior take & follow-ups

Contrast the two, show canary steps and automated analysis, then the data constraint.

Follow-up questions

Think of your answer first, then open the hint.

  1. Why must schema changes be compatible?

    Show hint

    Both versions run against the same database.

  2. Canary vs feature flag?

    Show hint

    Canary limits who runs new code; flags limit who sees a feature.

Suggest a fix if something here is wrong or out of date.