Compare Blue-Green vs Canary vs Rolling deployments in production
Quick Summary: Rolling updates replace instances gradually in place, Blue-Green swaps traffic between two identical full environments for instant rollback, and Canary shifts a tiny traffic percentage (e.g., 5%) to validate telemetry before scaling out.
Direct Interview Answer
Rolling Update is infrastructure-lean but briefly mixes v1 and v2 versions. Blue-Green ensures zero version mixing and sub-second rollback by keeping the idle Green stack warm until cutover, at 2× temporary compute cost.
Canary Releases minimize blast radius by routing 1–5% of live requests to the new build while watching error rates and P99 latency before promoting to 100%.
Detailed Technical Explanation
Regardless of strategy, database schema changes MUST follow the expand-and-contract pattern so both old and new application code run safely against the shared database during transition.
Practical Walkthrough
Kubernetes ReadinessGate + progressive Canary weight progression outline.
steps:
- setWeight: 5
- pause: { duration: 5m } # Verify 5xx error rate < 0.1% & P99 latency
- setWeight: 25
- pause: { duration: 10m }
- setWeight: 100
Progressive blast-radius containment with metric verification gates.
Real-World Production Use Case
High-traffic checkout APIs where releasing buggy payment validation to 100% of users simultaneously would cause major revenue loss.
Common Interview Mistakes to Avoid
- Deploying incompatible database schema renames during Rolling or Canary releases, breaking remaining old instances.