In this post you will learn about Blue-Green Deployment. This is a concept of dividing your production environment to two halves. One will have the current version of the product and serves customer requests. The other half will be upgraded to the next release and will be tested. There will not be any downtime and the risk of deployment failure is absolutely minute. It is one of the major causes of headaches for DevOps and the rest of the project team alike. Especially for large enterprise products, continuous delivery is required and here's one of the ways how to do it right.Blue-Green deployment means to have two identical environments at given time, one of which is active(blue), other as idle(green). The updates are pushed to idle environment and are tested. Then traffic is switched to idle environment(green). Hence idle(green then) becomes active(blue now) now and the previously active (blue then) becomes idle(green now).
If things go wrong (even after thorough testing!) then traffic is switched back to previously active environment.
Rolling deployments, traffic switch-over is nicely handled by terraform with its ability to create immutable infrastructure. While switching over, it waits for current requests to be serviced and send all new requests to newly activated environment, hence zero downtime.
Benefits
- You can test your production without pausing the production
- This way offers a rapid way to rollback
Drawbacks
- The project becomes more complex (which is solved by automating the workflow)
- The database might be incompatible (which is solved by database refactoring techniques)
No comments:
Post a Comment