1.Rolling, blue/green and canary
A **rolling** deploy replaces instances a few at a time, so both versions serve traffic while it runs. **Blue/green** brings up a whole second fleet, tests it, then switches all traffic at once — and switches back just as fast. A **canary** sends a small share of real traffic to the new version, watches the error rate, and only then continues. All three run two versions of your code against **one** database.
Key features
- All three run two code versions against one database — the schema must fit both
- Rolling: no extra capacity, both versions live, rollback is another full roll
- Blue/green: double capacity briefly, instant switch, instant switch back
- Canary: real evidence before full exposure — but only with per-version metrics
- Sessions, cache values and queued task payloads must be readable by both versions
- Workers are a third fleet: old consumers will read messages the new code wrote
The three strategies, compared on what they actually cost
What must be compatible across the two live versions
- Three small step charts side by side, each plotting the share of traffic served by the new version against time, from zero per cent at the bottom to one hundred per cent at the top.
- Rolling is a staircase climbing in four equal steps from zero to one hundred per cent, labelled "no extra capacity, both versions live throughout".
- Blue/green is flat at zero and then jumps straight to one hundred per cent in a single step, labelled "double capacity briefly, and the fastest rollback".
- Canary is flat at zero, rises to a narrow five per cent shelf that it holds for a long stretch, then jumps to one hundred per cent, labelled "evidence from real traffic before full exposure".
- A footer states that in all three cases both versions share one database, one cache and one queue, so the schema in effect must satisfy the old code and the new code at the same time.
Command
./deploy.sh --strategy canary --share 5 --watch-minutes 15The three strategies differ only in how fast the new version reaches 100% of traffic: rolling ramps with no extra capacity, blue/green steps with double capacity and the fastest rollback, and a canary holds a small share while you gather real evidence. All of them run two versions of the code against one database, one cache and one queue, so the schema, the session format, the cache values and the task payloads must all satisfy both versions at once — which is expand-and-contract, not a strategy choice. And a canary only works with per-version metrics; without them, five per cent of the errors disappears into normal variation.