Blue Cloud Solutions

Deployment Strategy for Node.js Application in AWS Elastic Beanstalk

Prev Question Next Question

Question

A company has a Node.js application deployed in an Elastic Beanstalk environment.

At the moment the environment uses an “All at once” deployment strategy.

The new versions are deployed in all instances simultaneously and there is a short time of outage.

If there is a problem with the new version, another deployment is required to perform the rollback.

Your manager asks you to use another method that deploys new versions to a fresh group of instances.

And the new instances should serve traffic only after the health check has passed.

In the meantime, you do not want to maintain two environments in Elastic Beanstalk.

Which deployment strategy should you select?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - D.

In order to deploy new versions in new instances, the Immutable deployment strategy should be chozen.

The references can be found in https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html and.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environmentmgmt-updates-immutable.html.

Option A is incorrect: For Rolling update, the original instances are detached from the load balancer for the deployment.

This update strategy does not create new instances.

Option B is incorrect: The Rolling with additional batch strategy still performs the deployments in existing instances although it creates another batch to maintain full capacity.

Option C is incorrect: For the swapping environment URLs feature in blue/green deployments, two environments are required in Elastic Beanstalk.

It does not meet the requirement of the question.

Option D is CORRECT: With Immutable deployment, a second, temporary Auto Scaling group with new instances is created for the update.

The deployments are immutable and not performed on old instances.

The answer to the question is A. Configure a Rolling update strategy in the Elastic Beanstalk environment. Deploy new application versions in new instances and then attach the instances to the original load balancer.

Explanation:

Elastic Beanstalk is a fully managed service provided by AWS for deploying, scaling, and managing web applications. Elastic Beanstalk uses different deployment strategies to deploy applications.

"All at once" is a deployment strategy in which the new version is deployed to all instances simultaneously, causing a short outage if there is a problem with the new version, requiring another deployment to perform the rollback.

The new deployment strategy requires deploying new versions of the application to a fresh group of instances, which should serve traffic only after the health check has passed. However, you do not want to maintain two environments in Elastic Beanstalk.

The Rolling update strategy is a deployment strategy that updates instances in batches. This strategy deploys the new version of the application to a new group of instances, allows the instances to pass the health check, and then swaps the instances with the old group of instances. This ensures that the application is running with the new version without downtime.

To use the Rolling update strategy, follow these steps:

  1. Create a new version of the application.

  2. Deploy the new version of the application to a new group of instances.

  3. Wait for the new group of instances to pass the health check.

  4. Swap the new group of instances with the old group of instances.

By using the Rolling update strategy, you can deploy new versions of the application without downtime, ensure that the new group of instances passes the health check before serving traffic, and avoid maintaining two environments in Elastic Beanstalk.

Option B is incorrect because it is not a valid deployment strategy in Elastic Beanstalk.

Option C is the blue/green deployment strategy, in which a new environment is created with the new version of the application, and after the environment passes the health check, traffic is routed to the new environment by swapping the URLs. This strategy requires maintaining two environments in Elastic Beanstalk.

Option D is the Immutable deployment strategy, in which a new group of instances is created with the new version of the application, and after the new group of instances passes the health check, traffic is routed to the new group of instances, and the old group of instances is terminated. This strategy requires maintaining two environments in Elastic Beanstalk.