DEV Community

Cover image for Blue-Green Deployment Explained
Ludivine A
Ludivine A

Posted on

Blue-Green Deployment Explained

Blue/Green deployment, also called Red/Black or A/B deployment, is a continuous deployment process created by Daniel North and Jez Humble in 2005.

The principle is to have two production environments, one called Blue, the other Green.

For example, the Green environment is the production version currently online, while the Blue environment is inactive.

Every new feature or bug fix is merged in the Blue environment. When it is time to release the new version of the website, a load balancer switches all users to the Blue environment, and the Green one becomes a backup version.

Benefits

The biggest benefit is that you can easily and quickly rollback in case of emergency.

There is zero downtime, as the load balancer shifts all users to the Green version, and if something goes wrong, they can all be switched back to the Blue version.

Drawbacks

Running two identical environments is expensive, and a pretty complex task.

Moreover, some users may encounter session problems, be forced to log back into the app …

Conclusion

Blue/Green deployment is an interesting solution. I would advise you to also research Canary Deployment, another great solution.


Photo by Blake Connally on Unsplash

Top comments (0)