Blue-Green Deployment
Blue-Green Deployment
A release method that keeps two identical production environments and updates by switching between them instantly
In Simple Terms
Blue-green deployment is a way of preparing two identical environments, getting the new one ready behind the scenes, and then switching over to it. You check that everything works in the background environment while the current one keeps running, and if all looks good, you move users over to it. You can update without stopping the service, and if something goes wrong, you can send users back to the original environment, so it's sometimes adopted for running web services and the like.
Behind the Name
The name comes from the two colors used to tell the two environments apart: one is called blue and the other green. The colors are just labels, so neither one means anything special. The name simply points to the pair of environments you swap between.
Take a Closer Look!
Blue-green deployment is a way of updating a system by preparing a second environment identical to the one currently running, then switching users over to it all at once.
With a typical update, the service sometimes has to be stopped for a while during the work. This approach lets you move to the new version without stopping anything, which is why it's used for running web services and similar systems.
Think of it like having two shops: you keep one open for business while you renovate the other, and when it's ready, you swap the signs.
First, while the blue environment that's currently in use keeps running, you put the new program into the green environment behind the scenes and check that it works.
If the tests turn up no problems, you switch the traffic from blue to green, and green starts serving as the new production environment. The blue environment, having done its job, can wait on standby for the next update, or be shut down if you don't need it.
Even if something goes wrong after the switch, you can point traffic back to the original blue environment and be back to normal in a short time.
On the other hand, because you have to prepare two production-sized environments to run at the same time, costs such as servers can add up.