# Concepts

## Blue/Green deployment

### Introduction

Blue/Green deployment, also called Red/Black in Spinnaker, is a deployment pattern based on switching traffic between two identical environments running different versions of an application.

This technique allows avoiding common pitfall associated with deploying a software, such as downtime and the lack of rollback capability.

Blue environment represents the current version of the application served in production. In parallel, the green environment is staged running a different version of the application. After the green environment is ready and tested, production traffic is redirected from blue to green environment.

If any problems are identified, you can rollback by reverting traffic back to the blue environment.

For example, We have an application called spinnaker-app. This application is served by a service called spinnaker-service. The first version deployed is the blue version of our application.

![](https://3518671160-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LycJ8Qr09hen8xsm-eC%2F-M-vRYhWaLpMuj7cRC6N%2F-M-vRu7hDv1M8aXWkjyS%2Fspinnaker%20B_G-devfest%20Blue%20\(2\).png?alt=media\&token=3973aff0-a291-4467-92a5-1b99dd0ef268)

We need to update our application to a newer version, which become the green version. Then a battery of tests should be run against this version in order to check if everything is working as expected.

![](https://3518671160-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LycJ8Qr09hen8xsm-eC%2F-M-vRYhWaLpMuj7cRC6N%2F-M-vS8flqC6GfK9Ru6Ae%2Fspinnaker%20B_G-devfest%20Green.png?alt=media\&token=98d94091-280a-451e-8232-b050505e524c)

After checking the green version is up and running, and work as expected, we switch the traffic from the blue version to the green version.

![](https://3518671160-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LycJ8Qr09hen8xsm-eC%2F-M-vRYhWaLpMuj7cRC6N%2F-M-vSEaluCo1ftI9V6wZ%2Fspinnaker%20B_G-devfest%20Switch.png?alt=media\&token=e8003201-cfdc-46db-b2fc-a625dde880a6)

Now the user uses the application version "green".

Let's say we notice a critical bug which passed through the validation process and has been deployed along the new version. Since the previous version of the application is still up and running , yet not exposed to production traffic, we can easily switch back the traffic from the new version to the old one.

![](https://3518671160-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LycJ8Qr09hen8xsm-eC%2F-M-vRYhWaLpMuj7cRC6N%2F-M-vSJpesTpW9HpC21DJ%2Fspinnaker%20B_G-devfest%20Green.png?alt=media\&token=03a1b9ce-d8cb-457e-9f72-a85e282368cc)

At the end of this section, we will create a Blue/Green deployment strategy
