Tech_Interview_Prep

Deployment Strategies (Blue-Green, Canary, Rolling)

Different ways to roll a new version out safely, trading off speed, blast radius, and infrastructure cost.

What it is

Deployment strategies control how a new version replaces an old one in production — each makes a different tradeoff between rollout speed, safety, and infrastructure cost.

Key points

  • Rolling deployment: gradually replaces old instances with new ones a few at a time — no extra infrastructure needed, but both versions run simultaneously during the rollout, and rollback means rolling forward again.
  • Blue-green deployment: the new version ("green") is deployed fully alongside the old ("blue"), then traffic is switched all at once — enables instant rollback (switch back), at the cost of running double the infrastructure temporarily.
  • Canary deployment: the new version receives a small percentage of real traffic first, monitored closely, before a full rollout — catches problems on a small blast radius before they affect everyone.
  • Feature flags are a complementary, finer-grained tool — they decouple deploying code from releasing a feature to users, letting a team ship dark and turn a feature on independently of any deployment.