Deployment strategies
Blue/green, canary, rolling — traffic shifting, bake time, automated rollback triggers. The classic senior screen question.
About 27 min read3-question knowledge check
The mental model
Every deployment strategy answers one question: how much production traffic is allowed to touch the new version before you are confident in it? Everything else — tooling, YAML, service meshes — is mechanism.
The analogy that sticks: a restaurant changing its menu.
- Recreate — close the restaurant, swap the menu, reopen. Simple, and there is a period where nobody eats. This is downtime deployment.
- Rolling — swap dishes table by table. No closure, but for a while half the diners get the old menu and half the new, and you cannot cleanly go back mid-service.
- Blue/green — build an identical second dining room with the new menu, keep the old one fully staffed, then move everyone through the new door at once. Rollback is walking back through the old door — seconds, not a redeploy. You pay for two dining rooms.
- Canary — send 5% of diners to the new menu, watch their faces, then 25%, then everyone. You discover the bad dish with 5% of the blast radius, but you need a way to watch faces — that is your metrics.
The name "canary" comes from canaries in coal mines: a small, sensitive thing sent ahead to detect danger before it reaches everyone. That is the whole idea — a deliberately small exposed population plus a signal you trust.
Two distinctions that senior interviews probe:
- Deployment is not release. Deployment puts code on machines; release exposes it to users. Feature flags let you deploy at 100% and release at 1% — often the cheapest form of progressive delivery, because it needs no traffic infrastructure at all.
- Rollback speed dominates rollback frequency. A strategy that fails 5% of users for 60 seconds beats one that fails 100% of users for 4 minutes, even if the second fails less often.
The full lesson continues with 15 more sections
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision