GKGulshan Kumar
HomeBlogBlue-Green Deployments: Achieving Zero D
CI/CD8 min read

Blue-Green Deployments: Achieving Zero Downtime in Production

GK
Gulshan Kumar
15 March 2025

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


Results


  • Zero downtime releases achieved ✅
  • Incident response improved by 30% (easy rollback)
  • Deployment confidence increased across the team

  • Lessons Learned


  • Database migrations must be backward-compatible during the switch
  • Session stickiness can be tricky — use external session stores (Redis)
  • Always have automatic rollback triggers based on error rate thresholds
  • ← Back to Blog✉️ Discuss this post