SAP-C02 exam dumps

SAP-C02 practice question 14 of 678

AWS Certified Solutions Architect - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

SAP-C02 Question 14

Single answer

An organization is running a critical web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application stores session data locally on the EC2 instances. The organization plans to scale the application to handle unpredictable traffic spikes while maintaining session consistency for users. Which solution is the MOST cost-effective and scalable for achieving this?

  1. A

    Enable sticky sessions (session affinity) on the Application Load Balancer.

  2. B

    Use Amazon ElastiCache to store session data.

  3. C

    Store session data on Amazon RDS using a Multi-AZ deployment.

  4. D

    Migrate the application to AWS Lambda and use Amazon DynamoDB for session storage.

Show answer and explanation

Correct answer: B

Explanation

The recommended solution is to use Amazon ElastiCache for session storage. ElastiCache provides an in-memory caching solution, which is highly scalable and cost-effective for session data. This approach decouples session data from the EC2 instances, allowing the application to scale horizontally without concerns about session consistency. Sticky sessions or RDS-based solutions are either less scalable or more expensive, while migrating to Lambda with DynamoDB introduces unnecessary complexity in this scenario.

  • A. Incorrect.

    Enabling sticky sessions on the ALB allows sessions to remain tied to specific EC2 instances, but this limits scalability and can lead to uneven traffic distribution during scaling events. It is not the most scalable or cost-effective solution.

  • B. Correct.

    Using Amazon ElastiCache to store session data offloads the session storage from the EC2 instances, enabling the application to scale horizontally without concern for local session data. This is both cost-effective and scalable.

  • C. Incorrect.

    Storing session data on Amazon RDS is a valid option, but it introduces higher costs and potential performance bottlenecks compared to in-memory caching solutions like ElastiCache.

  • D. Incorrect.

    Migrating the application to AWS Lambda and using DynamoDB for session storage may work, but it requires significant architectural changes. The question is focused on solving the problem for the existing setup in a cost-effective and scalable manner.

Timed practice exam

Take a SAP-C02 practice test under exam conditions

75 questions in 180 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam