DVA-C02 Question 46
Select 3You are developing a stateless web application that needs to scale rapidly during peak traffic on AWS. Which combination of services and approaches would best suit this requirement?
- A
Use Amazon S3 to store session data and static assets such as images and JavaScript files.
- B
Deploy the application on Amazon ECS with an Application Load Balancer to distribute traffic across tasks.
- C
Store session data in Amazon ElastiCache to ensure high performance and low latency.
- D
Use Amazon RDS to store session state to ensure data consistency across instances.
- E
Implement AWS Elastic Beanstalk to handle scaling and deployments automatically.
Show answer and explanation
Correct answers: B, C, E
Explanation
Stateless applications do not store user session data on the application servers themselves, which allows them to scale horizontally by adding or removing instances as needed. In this scenario, using ECS with a load balancer ensures proper traffic distribution, ElastiCache provides a low-latency session data solution, and Elastic Beanstalk simplifies deployment and scaling. These solutions align with the principles of stateless application design, making them the best choices.
- A. Incorrect.
Amazon S3 is a great option for storing static assets like images and JavaScript files, but it is not suitable for session data, which requires low-latency access and state management. Hence, this option is partially relevant but not ideal for the use case.
- B. Correct.
Deploying the application on ECS with an Application Load Balancer ensures that traffic is properly distributed across tasks in a stateless manner, allowing for horizontal scalability. This is a good choice for a stateless application.
- C. Correct.
Using Amazon ElastiCache for session data ensures high performance and low latency, which is critical for a stateless application that needs to scale rapidly. This is an appropriate solution.
- D. Incorrect.
Storing session state in Amazon RDS introduces a dependency on a stateful database, which is contrary to the stateless design principle. This is not an appropriate choice for the scenario.
- E. Correct.
AWS Elastic Beanstalk abstracts away the complexity of scaling and deployments, making it a good choice for quickly building and managing a stateless application. This is a valid solution.