In blue-green deployment, two environments are deployed in production simultaneously. The QA team performs various tests on the green environment. Once the green environment passes the tests, the load balancer switches users to it.
The active environemt (say, blue) serves the current live version of the application to the users. The idle one (green) is our playground where we can saftly deploy and test the new version.
Disadvantage
- At any given time, one side is active and visible to users, and the other is idle.
- Just like with the Rolling Deployment, we can not direct the new version to specific users. The switch from blue to green happens for all users at once.
- It is resource-intensive. Maintaining two identical production environments doubles the infrastructure and resource needs. We could spin down the idle envirment between deplyments, but this introduces complexity.
- Managing two parallel production environments and ensuring seamless data synchchronization. can add significant complexity to the deployment precess. It requires sophisticated infrastructure management and toolling.
Advantage
- This gives us the chance to catch and fix any bugs or issues before they reach our users.
- smooth user experience and reliable rollbacks.
- Once the new version in the green environment is deemed ready, we simply switch the load balancer to redirect traffic from the blue envirment to the greenone. Users are seamlessly transitioned to the new version of application with zero downtime. Now the blue environment because idle and serves as our safety net. If we encounter any issues with the new version, we can quickly switch back to the blue environment, effectively rolling back to the previous version. akkows for seamless transitios and easy rollbacks, there is a catch.