Skip to main content
>_ supraj.dev
TOPIC DEVOPS
Blue-Green Deployments shipping without downtime
IN 10 SECONDS

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.

GOTCHA Database changes must be backward-compatible because both Blue and Green environments share the same production database during switch transition.
HOW A SWAP ROUTING FLOWS
01 Staging Deploy code is deployed to the idle Green environment.
02 Verification QA tests Green while real traffic continues hitting the active Blue environment.
03 Switch router or DNS points to Green, turning it active instantly.
04 Fallback Blue is held idle for rollbacks. If tests pass, Blue is updated to match Green.
POKE IT YOURSELF
aws elbv2 modify-listener --listener-arn ... --default-actions Type=forward,TargetGroupArn=green-tg — route ALB traffic to the green target group
kubectl patch service my-app -p '{\"spec\":{\"selector\":{\"version\":\"green\"}}}' — point service selector to green pods