← Blog'a Dön
DEVOPS

What Is Blue-Green & Canary Deployment? Zero Downtime Guide

F. Çağrı Bilgehan26 Ocak 202610 dk okuma
deploymentblue-greencanarydevops

What Is Blue-Green & Canary Deployment? Zero Downtime Guide

Does every deployment give you a heart attack? Can you roll back instantly? Blue-Green and Canary Deployment deliver zero-downtime, safe releases.

1. Blue-Green Deployment

Two identical environments. Traffic switches instantly.

Before:  LB → [Blue v1.0] ← all traffic
After:   LB → [Green v2.0] ← all traffic
Rollback: LB → [Blue v1.0] ← instant switch back

✅ Zero downtime | ✅ Instant rollback | ❌ Double resource cost

2. Canary Deployment

Gradually roll out to a small percentage of users, then increase.

Phase 1:  5% → v2.0  | 95% → v1.0
Phase 2: 25% → v2.0  | 75% → v1.0
Phase 3: 100% → v2.0 → Full rollout ✅

✅ Gradual risk | ✅ Real user validation | ❌ Complex infrastructure

Istio Canary

http:
  - route:
      - destination: { host: app, subset: stable }
        weight: 95
      - destination: { host: app, subset: canary }
        weight: 5

3. Rolling Update

Update pods one at a time (Kubernetes default).

Comparison

| Strategy | Downtime | Rollback | Risk | Cost | |----------|----------|----------|------|------| | Recreate | Yes | Slow | High | Low | | Rolling | No | Medium | Medium | Low | | Blue-Green | No | Instant | Low | High | | Canary | No | Fast | Lowest | Medium |

Database Migrations

Use the Expand-Migrate-Contract pattern for backward-compatible schema changes.

Best Practices

  1. Combine with feature flags — Deployment ≠ release
  2. Health checks required — Auto-rollback unhealthy pods
  3. Automatic rollback — Set error rate thresholds
  4. DB backward compatibility — Deploy schema changes separately
  5. Smoke tests — Automated post-deploy verification

Conclusion

Zero-downtime deployment is the modern standard. Blue-Green provides instant switching, Canary manages risk gradually. Choose based on your team's needs.

Learn deployment strategies on LabLudus.

İlgili Yazılar

Infrastructure as Code (IaC) Nedir? Terraform ve Altyapı Otomasyonu

Infrastructure as Code nedir? Terraform, Pulumi, CloudFormation ile altyapı otomasyonu, versiyon kontrolü ve tekrarlanabilir deployment rehberi.

What Is Infrastructure as Code? Terraform & Automation Guide

IaC explained: Terraform, Pulumi, CloudFormation for infrastructure automation, version control, and repeatable deployments.