Compare rolling, blue-green and canary on the same change
Task
Deploy the same faulty version three ways and measure what each strategy costs in affected requests, in resources, and in time to roll back. The point is that the right answer depends on which of those three a scenario cares about.
Steps
- Prepare two images: a good one, and a 'bad' one that returns errors for 20% of requests. Deploy the good one with four replicas and start a client recording per-second success and failure counts.
- ROLLING: update to the bad image, detect the problem, and roll back. Record total failed requests, peak resource usage, and time from first error to full recovery in
lab/strategies.csv. - BLUE-GREEN: restore the good version, stand up a complete second deployment on the bad image, switch traffic, detect, switch back. Record the same three measures.
- CANARY: restore, then route roughly 10% of traffic to the bad image, detect from the canary's error rate, and withdraw it. Record the same three measures.
- Write
lab/strategies.mdnaming which strategy you would choose for each of: a limited-capacity cluster, a change that must be reversible instantly, and a risky change to a high-traffic service.
Verify
awk -F, 'NR>1 && NF>=4 {n++} END {print n" strategy result(s)"}' lab/strategies.csv
grep -Eci 'blue.green' lab/strategies.md
grep -Eci 'canary' lab/strategies.md
grep -Eci 'capacity|resource|double' lab/strategies.md
Three strategies measured, and canary should show the fewest affected requests while blue-green shows the fastest rollback and the highest resource cost. If all three look identical, the traffic rate was too low to distinguish them.
This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.