Q2 — AWS SAA-C03 Ch.13
Question 2 of 100 | ← Chapter 13
Q902. A company runs an ecommerce application on AWS. Amazon EC2 instances process purchases and store the purchase details in an Amazon Aurora PostgreSQL DB cluster.Customers are experiencing application timeouts during times of peak usage. A solutions architect needs to rearchitect the application so that the application can scale to meet peak usage demands.Which combination of actions will meet these requirements MOST cost-effectively? (Choose two.)
- A. Configure an Auto Scaling group of new EC2 instances to retry the purchases until the processing is complete. Update the applications to connect to the DB cluster by using Amazon RDS Proxy. ✓
- B. Configure the application to use an Amazon ElastiCache cluster in front of the Aurora PostgreSQL DB cluster.
- C. Update the application to send the purchase requests to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an Auto Scaling group of new EC2 instances that read from the SQS queue. ✓
- D. Configure an AWS Lambda function to retry the ticket purchases until the processing is complete.
- E. Configure an Amazon AP! Gateway REST API with a usage plan.
Correct Answer: A. Configure an Auto Scaling group of new EC2 instances to retry the purchases until the processing is complete. Update the applications to connect to the DB cluster by using Amazon RDS Proxy., C. Update the application to send the purchase requests to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an Auto Scaling group of new EC2 instances that read from the SQS queue.
Explanation
To meet the requirements of scaling the application to handle peak usage and address application timeouts, the following two actions can be taken:A. Configure an Auto Scaling group of new EC2 instances to retry the purchases until the processing is complete. Update the applications to connect to the DB cluster using Amazon RDS Proxy.By configuring an Auto Scaling group, new EC2 instances can be launched to handle increased traffic during peak usage. By retrying the purchases until processing is complete, the application can handle any temporary failures and ensure that all purchases are processed successfully. Updating the applications to connect to the DB cluster using Amazon RDS Proxy provides improved connection management, pooling, and scalability for the database connections, allowing the application to handle increased traffic efficiently.C. Update the application to send the purchase requests to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an Auto Scaling group of new EC2 instances that read from the SQS queue.By updating the application to send purchase requests to an SQS queue, the application can decouple the purchase processing from the frontend processing, allowing for asynchronous processing and reducing the chances of application timeouts. An Auto Scaling group of new EC2 instances can be configured to read from the SQS queue, ensuring that the purchase requests are processed in a scalable and efficient manner.Option B suggests configuring the application to use an Amazon ElastiCache cluster in front of the Aurora PostgreSQL DB cluster. While ElastiCache can improve performance by caching frequently accessed data, it may not directly address the issue of application timeouts during peak usage. Additionally, introducing ElastiCache may add additional cost and complexity to the architecture without directly addressing the scalability requirement. Therefore, Option B is not the most cost-effective solution.Option D suggests configuring an AWS Lambda function to retry the ticket purchases until the processing is complete. While Lambda functions can be used for serverless processing, using them for retrying purchases may introduce additional complexity and overhead. It is generally recommended to use EC2 instances or a queuing system for long-running processes such as purchase processing. Therefore, Option D is not the most suitable choice.Option E suggests configuring an Amazon API Gateway REST API with a usage plan. While API Gateway can be used for managing and scaling APIs, it may not directly address the issue of application timeouts during peak usage. Additionally, it may not be the most cost-effective solution for addressing the scalability requirement. Therefore, Option E is not the most suitable choice.In summary, to meet the requirements of scaling the ecommerce application and addressing application timeouts, configuring an Auto Scaling group with retry logic and using Amazon RDS Proxy (Option A) and updating the application to use Amazon SQS for asynchronous processing with an Auto Scaling group of EC2 instances reading from the SQS queue (Option C) are the recommended actions.