In: Computer Science
2. Compare the two deployment strategies presented in Chapter 6 (All-or-nothing deployment, Partial Deployment) in terms of their cost and complexity.
All or nothing deployment :In an all-or-nothing process: at the end of the deployment either all of the virtual machines (VMs) running a service have had the upgraded version deployed or none of them have.
There are two types of all or nothing deployment.
1) Blue Green deployment:A blue/green
deployment is a change management strategy for releasing software
code. Blue/green deployments, which may also be referred to as A/B
deployments require two identical hardware environments that are
configuredexactly the same way. While one environment is active and
serving end users, the other environment remains idle.
Cost and complexity- This strategy is conceptually
simple, but has some disadvantage:
-It is expensive in terms of both VM and software licensing
costs.
-The provisioning of the N VMs containing version B prior to
terminating all version A VMs is the source of the cost. For this
period of time, the VM-based cost doubles.
-The provisioning of the hundred (or more) new VMs (even if it can
be done in parallel) hundreds of VMs can be time-consuming.
-Long-running requests and stateful data during the switch-over and
rollback require special care.
2)Rolling upgrade deployment:A rolling upgrade
consists of deploying a small number of version B VMs at a time
directly to the current production environment, while switching off
the same number of VMs running version A. For example, we deploy
one version B VM at a time. Once an additional version B VM has
been deployed and is receiving requests, one version A VM is
removed from the system. Repeating this process N times results in
a complete deployment of version B.
Cost and complexity-This strategy is inexpensive
but more complicated. It may cost a small number of additional VMs
for the duration of the deployment, but again introduces a number
of issues of consistency and more risks in disturbing the current
production environment.
-The additional cost of a rolling upgrade can be low if you conduct
your rolling upgrade when your VMs are not fully utilized, and your
killing of one or a small number of VMs at a time still maintains
your expected service -It may cost a bit if you add a small number
of VMs before you start the rolling upgrade to mitigate the
performance impact and risk of your rolling upgrade.
-During a rolling upgrade, one subset of the VMs is providing
service with version A, and the remainder of the VMs are providing
service with version B. This creates the possibility of failures as
a result of mixed versions.
Partial Deployment: It is of two types-
1)Canary testing-In software testing, a canary (also called a canary test) is a push of programming code changes to a small number of end users who have not volunteered to test anything. The goal of a canary test is to make sure code changes are transparent and work in a real world environment.
Cost and commplexity: The mechanism for performing the canary tests depends on whether features are activated with feature toggles or whether services are assumed to be forward or backward compatible. In either case, a new feature cannot be fully tested in production until all of the services involved in delivering the feature have been partially deployed.
Messages can be routed to the canaries by making the registry/load balancer canary-aware and having it route messages from the designated testers to the canary versions. More and more messages can be routed until a desired level of performance has been exhibited.
If new features are under the control of feature toggles, then
turning on the toggle for the features on the canary versions
activates these features and enables the tests to proceed.
If the services use forward and backward compatibility, then the
tests will be accomplished once all of the services involved in a
new feature have been upgraded to the new version.
In either case, you should carefully monitor the canaries, and they
should be rolled back in the event an error is detected.
2)A/B Testing - AB testing is essentially an
experiment where two or more variants of a page are shown to users
at random, and statistical analysis is used to determine which
variation performs better for a given conversion goal.
Cost and complexity: Implementing A/B testing is similar to implementing canaries. The registry/ load balancer must be made aware of A/B testing and ensure that a single customer is served by VMs with either the A behavior or the B behavior but not both. The choice of users that are presented with version B (or A) may be randomized, or it may be deliberate. If deliberate, factors such as geographic location, age group (for registered users), or customer level (e.g., "gold" frequent flyers), may be taken into account.