What is blue-green deployment and how does it achieve zero-downtime releases?
Answer
Blue-green deployment maintains two identical production environments — blue (currently live) and green (new version). The new release is deployed to the idle environment (green), where it is fully tested including smoke tests and health checks. When confident, the load balancer switches 100% of traffic from blue to green in seconds — this is the actual "deployment" moment and it is instantaneous. If the green environment exhibits problems after the switch, rollback is immediate: flip the load balancer back to blue. The key requirements are: both environments must be provisioned and maintained simultaneously (doubling infrastructure cost during transitions), database migrations must be backward-compatible (both blue and green must work with the same database schema), and session affinity must be handled carefully. Blue-green is particularly effective for stateless services and is widely used with AWS Elastic Beanstalk, Kubernetes, and Heroku.
Previous
What is a deployment environment (dev, staging, prod) in CI/CD?
Next
What is a canary release and how does it reduce deployment risk?
More CI/CD Pipelines Questions
View all →- Intermediate What is a canary release and how does it reduce deployment risk?
- Intermediate What is a rolling deployment and how does it compare to blue-green?
- Intermediate What are feature flags and how do they integrate with CI/CD?
- Intermediate What is the testing pyramid in CI/CD and where does each test type run?
- Intermediate What are code quality gates (SonarQube, coverage thresholds) in CI/CD?