Per AWS documentation, I get the impression that Immutable and Blue/Green are the same thing, just a different name. In both cases you are creating an entirely new set of servers and transitioning to those servers at the final step of deployment.
Perhaps there are some fine details that differentiate these two. But if so fine, what is the point of making them distinct when they are practically the same thing?
Per AWS docs: (source: https://docs.aws.amazon.com/whitepapers/latest/practicing-continuous-integration-continuous-delivery/immutable-and-bluegreen-deployment.html)
The immutable pattern specifies a deployment of application code by starting an entirely new set of servers with a new configuration or version of application code. This pattern leverages the cloud capability that new server resources are created with simple API calls.
The blue/green deployment strategy is a type of immutable deployment which also requires creation of another environment. Once the new environment is up and passed all tests, traffic is shifted to this new deployment. Crucially the old environment, that is, the “blue” environment, is kept idle in case a rollback is needed.
The "crucially" sentence makes it sound like that is the differentiating factor but in immutable deployments you can keep the old instances in their target group idle post deployment too, if you wanted.
they are executed differently:
immutable: in the same environment (so under the same load balancer) a new autoscaling group is created alongside the old one. As soon as the first new instance is created it starts to serve traffic. When the new instances are all healthy the old ones are switched off.
blue/green: a new environment is created from scratch (so another load balancer). The switch is performed at DNS level routing the traffic from the OLD to the NEW when the new environment is ready and healthy.
The main difference is that in the immutable update, the new instances serve traffic alongside the old ones, while in the blue/green this doesn't happen (you have an instant complete switch from old to new).
So, in certain cases, for example:
you have to use the Blue-Green Deployment strategy.
To add to the above answer:
Immutable vs Rolling
Immutable deployment is actually considered to be an alternative to Rolling Deployment. The main differences are as follows:
| Rolling | Immutable |
|---|---|
| New new ASG is created | Second ASG is created and it serves traffic alongside first ASG until deployment is done |
| Deployment takes place on batches of existing instances | Only one but a brand new instance is created first If passes health check, additional instances are created until the number of instances matches with the first ASG |
| Failure requires manual redeploy of old version | Rollback is achieved by terminating the second ASG |
| How Rolling Deployments work? | How Immutable Deployments work? |
Immutable/Rolling vs Blue-Green
A blue-green deployment is quite different from both the above deployments.
In all these deployments, there is a zero-downtime, and the impact of failure will be minimal.
Canary Deployments
Summary of differences from AWS documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With