Explain blue-green deployment, its prerequisites, and how it reduces deployment risk.
Tests operational maturity for zero-downtime cutover. Great answers: parallel environments, load balancer switching, backward-compatible schemas, externalized state, and instant rollback vs partial in-place failure.
What's really being asked
Whether you can design a deployment strategy that eliminates in-place mutation risk by running two isolated production environments and cutting over traffic atomically. Interviewers want to see that you understand this is not just "two servers" but a cross-layer contract involving infrastructure orchestration, application statelessness, and database schema discipline.
The full answer
First, the core concept: blue is live production, green is an identical stack running the new version, and a load balancer or DNS switch moves traffic instantly. Second, infrastructure prerequisites: you need automated provisioning so green is truly identical, a health check mechanism to validate green before cutover, and enough capacity to run both environments simultaneously without starving blue. Third, application prerequisites: sessions must be externalized to Redis or a database so requests can bounce between environments without loss, and configuration must be environment-agnostic so green does not accidentally point to blue backends. Fourth, database prerequisites: schema changes must be backward compatible so both blue and green can read and write safely during the transition; destructive changes like column drops happen only after green is fully promoted and blue is drained. Fifth, risk reduction: because the old environment stays warm, rollback is a single traffic switch rather than a redeploy, and you never suffer partial fleet updates where some nodes are on different versions.
The mistakes people make
Calling it a rolling update or canary; these reuse the same infrastructure. Saying you need zero schema changes instead of backward-compatible ones. Ignoring the doubling of infrastructure cost and capacity. Claiming blue-green solves database migrations automatically without explaining expand-contract patterns or compatibility windows.
What usually comes next
How do you handle long-running transactions during cutover? What happens if green passes health checks but fails under real traffic? How do you manage database migrations when the schema must serve two application versions? When would you choose canary over blue-green?
A concrete example
A web service on EC2 behind an ALB uses blue-green deployment. The Auto Scaling group for green is cloned from blue via infrastructure as code. The database adds a new nullable index before cutover so green can use it while blue ignores it. Sessions live in ElastiCache, so users do not notice the ALB target group switch. If error rates spike after cutover, the ALB shifts traffic back to blue in under thirty seconds while the team debugs green.
Interview question
Which characteristic of blue-green deployment most directly enables sub-minute rollback during a failed release?
- a.Traffic is shifted gradually to green while health metrics are monitored.
- b.Green runs on the existing production instances alongside blue, separated by process or port isolation.
- c.The blue environment remains fully operational and ready to receive traffic after cutover.Correct
- d.Database schema changes are automatically rolled back by the orchestrator if green fails.
Why? this is the answer
The card states that because the old environment stays warm, rollback is a single traffic switch rather than a redeploy. Option A describes a canary release, which reuses the same infrastructure and gradually shifts traffic, making it a common misconception rather than true blue-green behavior.
Just read this? Test yourself on what you have been reading.
Read the original → docs.aws.amazon.com
- #ci/cd
- #deployment
- #infrastructure
- #blue-green
- #operations
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on ci/cd — each one lists the topics its interview covers.
See open roles