Question #46 of 60•Scaling•Medium• ~3 min read

What are the trade-offs of Blue-Green, Canary, and Rolling Deployments?

Executive Takeaway

Compare zero-downtime deployment strategies across infrastructure costs, rollback speed, and blast radius risk.

Architectural Breakdown & AnalysisFAANG Aligned

Deploying code updates safely requires balancing release speed against outage risks.

1. Blue-Green Deployment

  • Maintains two identical production environments (Blue = active live, Green = new version).
  • Switch router traffic to Green instantly.
  • Pros: Instant rollback by switching router back to Blue.
  • Cons: Doubles infrastructure costs.

2. Canary Deployment

  • Routes a small percentage of live traffic (e.g., 5%) to the new version. Monitors error rates before expanding to 100%.
  • Pros: Minimizes blast radius of bugs.
  • Cons: Requires complex router traffic management.

3. Rolling Deployment

  • Updates instances incrementally (e.g., 25% at a time) within the cluster.
  • Pros: Zero extra infrastructure cost.
  • Cons: Slow rollbacks if bugs appear late in the rollout.
TIP — Production Choice

Combine Canary Deployments with automated metric rollbacks for mission-critical microservice deployments.

Key Architectural Comparison

Deployment StrategyDowntimeRollback SpeedInfrastructure CostBlast Radius Risk
Rolling DeploymentZeroSlower (Requires reverse roll).Standard ($1\times$).Moderate (Bugs hit all users gradually).
Blue-Green DeploymentZeroInstantaneous (Switch router traffic).High ($2\times$ full environment cost).Low (Immediate rollback to Blue environment).
Canary DeploymentZeroFastLow ($1.1\times$).Lowest (Only 1–5% of live traffic tests new code).
Previous QuestionHow do you design an In-Memory Key-Value Store (Redis Architecture)?Next Question How do you design secure storage for Passwords, API Keys, and Sensitive PII?

Continue Learning on Being SDE

Explore deep-dive system architecture modules, low-level object-oriented designs, and interview cheat sheets.