Blue-Green deployment: duy trì hai production environments (blue=current live, green=new version).
- Deploy lên green, chạy integration tests, rồi switch traffic tại load balancer (nginx upstream, AWS ALB target groups, Kubernetes ingress) — switch instant, không có downtime.
- Rollback instant: nếu issue phát hiện sau deploy, switch traffic back về blue — green vẫn còn đó.
- Implementation với load balancer: Nginx upstream block với weight; AWS ALB forward rules; Kubernetes service selector switch.
- Cost: phải maintain 2 environments song song — expensive cho large infrastructure.
- Database migrations: challenge lớn nhất — migration phải backward-compatible với cả blue và green code (không thể drop column trong green nếu blue vẫn dùng).
- Canary deployment: deploy phiên bản mới cho một phần nhỏ users (1-5%), monitor metrics (error rate, latency, business metrics), rồi dần tăng percentage nếu ổn.
- Metrics cần monitor: error rate tăng đột biến, P99 latency tăng, conversion rate giảm, custom business metrics (orders/minute).
- Rollback trigger: tự động rollback nếu error rate vượt threshold.
- Implementation: Kubernetes với Flagger hoặc Argo Rollouts tự động canary với metric-based promotion; feature flags như LaunchDarkly cho canary ở application level.
- A/B testing vs Canary: A/B test new feature/UI cho subset users để measure business impact; Canary là risk reduction strategy cho infrastructure changes — có thể kết hợp cả hai.