Back to Developer Roadmap

Blue Green Deployment

src/data/question-groups/devops/content/blue-green-deployment.md

4.01.7 KB
Original Source

Blue-green deployment is a release strategy that reduces downtime and the risk of production issues by running two identical production environments, referred to as "blue" and "green."

At a high level, the way this process works is as follows:

  • Setup Two Environments: Prepare two identical environments: blue (current live environment) and green (new version environment).
  • Deploy to Green: Deploy the new version of the application to the green environment through your normal CI/CD pipelines.
  • Test green: Perform testing and validation in the green environment to ensure the new version works as expected.
  • Switch Traffic: Once the green environment is verified, switch the production traffic from blue to green. Optionally, the traffic switch can be done gradually to avoid potential problems from affecting all users immediately.
  • Monitor: Monitor the green environment to ensure it operates correctly with live traffic. Take your time, and make sure you’ve monitored every single major event before issuing the “green light”.
  • Fallback Plan: Keep the blue environment intact as a fallback. If any issues arise in the green environment, you can quickly switch traffic back to the blue environment. This is one of the fastest rollbacks you’ll experience in deployment and release management.
  • Clean Up: Once the green environment is stable and no issues are detected, you can update the blue environment to be the new staging area for the next deployment.

This way, you ensure minimal downtime (either for new deployments or for rollbacks) and allow for a quick rollback in case of issues with the new deployment.