What's the difference between Red/Black deployment and Blue/Green Deployment?
Asked Answered
F

2

90

I've heard both used to describe the idea of deploying an update on new machines while keeping old machines active, ready to rollback if an issue occurs. I've also heard it used to describe sharing load between updated services and old service, again for the purpose of a rollbacks —sometimes terminating inactive older patches and sometimes not.

My understanding also is that it is strictly for cloud services.

Can someone help to demystify these terms?

Foliated answered 22/7, 2017 at 21:57 Comment(1)
While I mention cloud services, this is also applicable to bare metal, or any large enough service. YMMV.Foliated
V
59

Both blue/green and red/black deployment represent the same concept.

While the first is the most common term, the latter seems to be used mainly in Netflix and their tools (like Spinnaker).

They apply only to cloud, virtualized or containerized services in the sense your infrastructure has to be automatable in order to make sense of this approach.

Vespertine answered 14/11, 2017 at 7:36 Comment(0)
R
100

Blue-green deployment

Classic deployment technique described in the Continuous Delivery book by Jez Humble and David Farley:

The idea is to have two identical versions of your production environment, which we’ll call blue and green... Users of the system are routed to the green environment, which is the currently designated production. We want to release a new version of the application. So we deploy it to the blue environment... This does not in any way affect the operation of the green environment. We can run smoke tests against the blue environment to check it is working properly. When we’re ready, moving to the new version is as simple as changing the router configuration to point to the blue environment instead of the green environment. The blue environment thus becomes production. This switchover can typically be performed in much less than a second. If something goes wrong, we simply switch the router back to the green environment.'

Humble and Farley then go on to mention the main challenge: dealing with database schema changes between green and blue versions.

The main benefit of blue-green deployment is zero or near-zero downtime when releasing a new version. And blue-green deployment enables canary releasing.

Red-black deployment

The Red version is live in production. You deploy the Black version to one or more servers. When the Black version is fully operational, you switch the router to direct all traffic to it (or you scale Red to 0 instances and Black to N). If anything goes wrong, you revert the operation. So, it's similar to blue-green deployment, but there's a slight difference: in blue-green deployment, both versions may be getting requests at the same time temporarily, while in red-black only one of the versions is getting traffic at any point in time. Here's some corroboration:

At any time, only one of the environments is live, with the live environment serving all production traffic. For this example, Red is currently live and Black is idle (in this case we have kept the Black down-scaled to zero servers)...

Therefore, red-black is a specialization of blue-green. But red-black deployment is a newer term being used by Netflix, Istio, and other frameworks/platforms that support container orchestration. The actual meaning can vary and many people are using "red-black" as another term for "blue-green", maybe just because their team colors are red and black. :^)

Respect answered 2/8, 2018 at 12:42 Comment(10)
citation please? I am glad if there is an exact commonly agreed definition for clarifying either combination from each other, but do we have the references to point people to? This is important for grounding technical discussions on pre-existing definitions!Apollonius
Let me provide a follow-up to my own comment: * blue/green: Continuous Delivery book by Jezz Humble David Farley (as you cited) serves as a solid definition ground * red/black: it would be great if the text here spinnaker.io/concepts , did not mention it this way red/black (aka blue/green); let me remind that spinnaker is coming from netflix itself!Apollonius
@Apollonius I fully agree with you that we should have an agreed upon definition to ground technical discussions. Perhaps Humble and Farley will write about red-black vs blue-green in a second edition.. :^) In any case I added a quote that corroborates the slight difference I mentioned.Respect
@Apollonius I'd seen the "aka blue/green" on Spinnaker web page. It seemed to me a non-meticulous use of these technical terms. (If not, someone from Spinnaker could clarify why to say "red-black" if we all have been using "blue-green" to mean the same thing.)Respect
@PauloMerson: I see nothing in that post that corroborates your claim that the terms blue-green and red-black are differentiated by whether a period of time exists where the load balancer might direct traffic to both the old and new instances. Do you have any more explicit source for the idea that the term red-black has a distinct meaning from blue-green?Tomtit
@PauloMerson Also, Martin Fowler's description of blue-green indicates that the cut-over is instantaneous (he says you switch the router, which implies that no requests go to the old hosts). So if the person who popularized the concept of blue-green wasn't saying that it inherently includes a period of mixed instances servicing requests, I wonder whether maybe you're trying to draw/claim a distinction where one doesn't actually exist.Tomtit
@Tomtit Router is pointing to blue; regular user traffic goes to blue; then green is deployed in production; you can access green bypassing the router; you often do that to assert green is working fine; but both green and blue are serving requests in production for a period of time; when you're confident green is reliable you switch the router to green to direct regular user traffic to it. Humble and Farley mention in the book an organization that had five production environments running in parallel.Respect
@PauloMerson So how is that different from red-black? Are you saying that if black is idle, something prevents you from bypassing the router and directly accessing those hosts? If so, please provide a citation for both what that is and that that's defined to be part of red-black. If not, that's exactly like your description of blue-green.Tomtit
To whomever is still confused: blue/green deployments are a concept with varying implementations. If you want to know how Netflix and Spinnaker are doing it, read the Netflix tech article. If you want to know which blue/green variants Spinnaker offers and how they are implemented, read the Spinnaker deployment strategies. Btw: Spinnaker also offers "rolling red/black" deployment as a strategy, which is no different to "standard" blue/green deployments.Planimeter
For me it's the same thing. Netflix is most commonly using "red-black" instead of "blue-green" perhaps because their logo colors are red and black. No need to look further ...Crucial
V
59

Both blue/green and red/black deployment represent the same concept.

While the first is the most common term, the latter seems to be used mainly in Netflix and their tools (like Spinnaker).

They apply only to cloud, virtualized or containerized services in the sense your infrastructure has to be automatable in order to make sense of this approach.

Vespertine answered 14/11, 2017 at 7:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.