DEVOPS / A CONCEPT NOTE
Blue-Green Deployments
shipping without downtime
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
A zero-downtime release pattern where two identical production environments (Blue/active, Green/staging) exist. You deploy changes to Green, test it, then switch the router to direct traffic to Green.
02 / FOLLOW THE MECHANISM
How a swap routing flows
Staging Deploy
code is deployed to the idle Green environment.
Verification
QA tests Green while real traffic continues hitting the active Blue environment.
Switch
router or DNS points to Green, turning it active instantly.
Fallback
Blue is held idle for rollbacks. If tests pass, Blue is updated to match Green.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
route ALB traffic to the green target group
aws elbv2 modify-listener --listener-arn ... --default-actions Type=forward,TargetGroupArn=green-tgThe ellipsis omits required code or values. This sketch is not runnable as written.
point service selector to green pods
kubectl patch service my-app -p '{\"spec\":{\"selector\":{\"version\":\"green\"}}}'05 / CHECK YOURSELF
Could you explain Blue-Green Deployments to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in Delivery & operationsDeclarative vs Imperativedescribing vs commanding