Information Technology Reference
In-Depth Information
11.6 Blue-Green Deployment
Blue-green deployment is similar to proportional shedding but does not require twice as
many resources. There are two environments on the same machine, one called “blue” and
the other called “green.” Green is the live environment and blue is the environment that is
dormant. Both exist on the same machine by a mechanism as simple as two different sub-
directories, each of which is used as a different virtual host of the same web server. The
blue environment consumes very little resources.
When the new release is to go live, traffic is directed to the blue environment. When
the process is finished, the names of the environments are swapped. This system permits
rolling back to the previous environment to take place easily.
Thisisaverysimplewayofprovidingzero-downtimedeploymentsonapplicationsthat
weren't designed for it, as long as the applications support being installed in two different
places on the same machine.
11.7 Toggling Features
As discussed in Section 2.1.9 , it is a common practice to tie each new feature to a software
flag orconfiguration setting sothat such features can be individually turned onoroff.Tog-
gling the switch is known as flag flipping . New features that are incomplete and not ready
for use by live users have their flags off. When they are ready for use, the flag is turned on.
The feature can be disabled if problems are found. Having a flag off is also called hiding a
feature behind a flag.
Feature toggling is one way to implement the general principle of decoupling deploy-
mentandrelease.Deploymentisputtingapackageintoanenvironment.Releaseismaking
a feature available to users. We often achieve release through deployment and, therefore,
assume one implies the other. In fact, feature toggles decouples these two concepts so that
deployment can happen all the time while release happens on demand. Deployment be-
comes a purely technical activity that users are unaware of.
There are many ways to implement the flag mechanism. The flags can be command-
lineflags,usedwhenstartingtheservice.Forexample,startingaspellcheckerservicewith
version 2 of the spell check algorithm enabled, and the morphological algorithm disabled,
might involve running a command such as the following:
Click here to view code image
$ spellcheck-server --sp-algorithm-v2 --morphological=off
The flag might be set via shell environment variable. The variables are set prior to run-
ning the command:
Search WWH ::




Custom Search