What is Blue-Green Deployment?
Blue-Green deployment is a release strategy that reduces downtime by running two identical production environments — Blue (live) and Green (staging the new version). When the new release is ready, traffic is switched from Blue to Green, making it instantly live.
Why We Needed It
At Onsurity, our monolithic deployments caused 5–10 minutes of downtime per release, impacting our health insurance platform users. We needed a seamless switch.
Implementation on AWS
# Switch target group to new deployment
aws elbv2 modify-listener \
--listener-arn $LISTENER_ARN \
--default-actions Type=forward,TargetGroupArn=$GREEN_TG_ARN
We used AWS Application Load Balancer target groups to route traffic. The pipeline:
1. Deploy new version to the Green ASG
2. Run smoke tests against Green
3. Shift 10% traffic → monitor → shift 100%
4. Keep Blue running as instant rollback