StoicBuilder

HandbookX the PortusCanary and blue-green deploys

Xthe Portus, Ship it

Canary and blue-green deploys

1 min readUpdated 28 November

In plain words

A canary deploy sends a small share of traffic to the new version and watches it before sending more, while blue-green runs old and new side by side and switches all traffic at once, with instant switch-back.

Where you see it

Harbor's API runs on two identical sets of servers. Version 41 serves everyone from blue while version 42 starts on green; once its checks pass, the load balancer moves traffic to green, and blue stays up for an hour in case you need to switch back. Hosts like Vercel offer a version of this: old deployments stay alive, and Instant Rollback points the domain back at one.

Canary rollout planconfig
step 1 5% of traffic to v42 wait 15 min check error rate and p95 latencystep 2 25% of traffic to v42 wait 30 min same checksstep 3 100% of traffic to v42stop error rate above 1% or p95 above 800 ms: all traffic back to v41
The stopping rule is written before the rollout starts, so nobody argues with a graph at midnight.

What goes wrong

  1. A canary nobody watches

    Sending 5% of traffic to the new version only helps if someone, or something, compares its error rate with the old one. Decide the numbers that stop the rollout, and automate the check where you can.

  2. Database changes only one version understands

    During a canary or a switch, old and new code run against the same database at once. If version 42 drops a column version 41 still reads, switching back won't save you, so make schema changes work with both.

  3. Shutting down the old side too soon

    Switching traffic moves new requests, but jobs already running on blue, and customers halfway through checkout, still need it. Let the old version finish its work before you turn it off.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Plan a canary rollout for this release: the traffic steps, how long to wait at each, and the error rate and latency numbers that stop it and send everyone back. Check that every database change in this release works while the old and new versions of the code run at the same time.

Quick check

Sign in to earn +10 XP for it

During a canary of Harbor's v42 at 5% of traffic, v42's error rate is 4% against 0.2% for v41. What do you do?

Got a prompt that touches canary and blue-green deploys?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.