they are executed differently, in a few words without too much details:
immutable: in the same environment (so under the same load balancer) a new autoscaling group is created alongside with the old one. Since 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:
- if you application depends on some configuration that has to change from the old
version to the new one
- the new version cannot run at the same time of the old one because of application
constraints
- "you want to update an environment to an incompatible platform version" (taken from the
AWS doc)
you have to use the blue/green strategy.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…