Rollback Strategies for Failed Deployments | Best Practices and Solutions

Implementing Efficient Rollback Strategies for Failed Deployments

Prev Question Next Question

Question

You recently encountered a major bug in your web application during a deployment cycle.

During this failed deployment, it took the team four hours to roll back to a previously working state, which left customers with a poor user experience.

During the post-mortem, you team discussed the need to provide a quicker, more robust way to roll back failed deployments.

You currently run your web application on Amazon EC2 and use Elastic Load Balancing for your load balancing needs.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

The AWS Documentation mentions the following.

AWS DeploymentCommand has a rollback option in it.

Following commands are available for apps to use:

deploy: Deploy App.

Ruby on Rails apps have an optional args parameter named migrate.

Set Args to {"migrate":["true"]} to migrate the database.

The default setting is {"migrate":["false"]}.

The "rollback" feature Rolls the app back to the previous version.

When we are updating an app, AWS OpsWorks stores the previous versions, maximum of upto five versions.

We can use this command to roll an app back as many as four versions.

Reference Link:

http://docs.aws.amazon.com/opsworks/latest/APIReference/API_DeploymentCommand.html

The correct answer is A. Create deployable versioned bundles of your application. Store the bundle on Amazon S3. Re-deploy your web application on Elastic Beanstalk and enable the Elastic Beanstalk auto - rollback feature tied to CloudWatch metrics that define failure.

Explanation:

In the scenario described, the team encountered a major bug during a deployment cycle that caused a four-hour rollback, leaving customers with a poor user experience. The team recognizes the need to provide a quicker, more robust way to roll back failed deployments.

Option A recommends creating deployable versioned bundles of the application and storing them on Amazon S3. The team should redeploy the web application on Elastic Beanstalk and enable the Elastic Beanstalk auto-rollback feature tied to CloudWatch metrics that define failure. This approach provides the ability to deploy new versions of the application and revert to previous versions quickly and efficiently.

Option B suggests using an AWS OpsWorks stack to redeploy the web application and initiate a rollback during failures. AWS OpsWorks DeploymentCommand is used to trigger the rollback. However, OpsWorks is not the best option for this scenario since Elastic Beanstalk provides a more straightforward solution for deploying and rolling back web applications.

Option C also recommends creating deployable versioned bundles of the application and storing them on Amazon S3. However, it suggests using AWS OpsWorks application versioning to initiate a rollback during failures. While this option provides versioning, it requires more configuration and maintenance than Option A, making it less efficient.

Option D suggests using Elastic Beanstalk to redeploy the web application and triggering a FailedDeployment API call to initiate a rollback. However, Elastic Beanstalk already has a built-in auto-rollback feature that does not require API calls.

In conclusion, Option A is the best solution as it provides an efficient and straightforward way to deploy and rollback web applications on Elastic Beanstalk using Amazon S3 and CloudWatch metrics.