What is blue-green deployment and how does it achieve zero downtime?
A blue-green deployment is where you have two identical environments in an active/passive configuration. The active environment receives live traffic and the passive can receive test traffic.
These are independent environments. It can be just one layer in the stack, or the whole stack — for example, just the web server layer or the entire application stack.
If we label the live environment as green, the blue environment can be used for the new release or deployment, and undergo QA (Quality Assurance) testing before the decision to switch.
The switch from green to blue is near instant, and because we have already tested the blue environment, we can be confident that no downtime will occur.
Should the worst happen, a rollback is near instant too — simply switching traffic back from blue to green.