Loading pattern...

What is Blue-Green Deployment?

Blue-Green Deployment runs two identical production environments—Blue (current) and Green (new version). Users on Blue, you deploy to Green, test it, then switch traffic from Blue to Green. If something breaks, instant rollback by switching back to Blue. Zero downtime, instant rollback. Alternative to risky "take site down, deploy, hope it works" approach. Common in mature engineering orgs.

When Should You Use This?

Use Blue-Green when you need zero-downtime deployments, instant rollback capability, or want to test production environment before users see it. Great for customer-facing apps where downtime is unacceptable. Requires infrastructure to run two environments (costs 2x during deploy). Simpler alternative: rolling deployments (deploy gradually to servers). Platforms like Vercel do this automatically.

Common Mistakes to Avoid

  • Database migrations—schema changes break old version, plan carefully
  • State in servers—sessions/cache lost on switch, use external state store
  • No smoke tests—switch to Green without testing, breaks anyway
  • Instant switch—switch 100% at once, should gradually shift traffic (canary)
  • Cost—running two environments doubles infrastructure cost during deploy

Real-World Examples

  • Netflix—Blue-Green deployments across regions for zero downtime
  • Stripe—Can rollback API changes instantly if issues detected
  • Vercel—Every deployment is Blue-Green, instant rollback in UI
  • Large SaaS—Blue-Green for main application, gradual for databases

Category

System Design Patterns

Tags

blue-greendeploymentdevopszero-downtimesystem-design

Permalink