Q51 — AWS SAA-C03 Ch.1
Question 51 of 65 | ← Chapter 1
Q51. A company owns an asynchronous API that is used to ingest use requests and, based on the request type, dispatch requests to the appropriate microservice for processing. The company is using Amazon API Gateway to deploy the API front end, and an AWS Lambda function that invokes Amazon DynamoDB to store user requests before dispatching them to the processing microservices. The company provisioned as much DynamoDB throughput as its budget allows, but the company is still experiencing availability issues and is losing user requests. What should a solutions architect do to address this Issue without impacting existing users?
- A. Add throttling on the API Gateway with server-side throttling limits
- B. Use DynamoDB Accelerator (DAX) and LamDda to buffer writes to DynamoDB
- C. Create a secondary index in DynamoDB for the label with the user requests.
- D. Use the Amazon Simple Queue Service (Amazon SQS) queue and Lambda to buffer writes to DynamoDB. ✓
Correct Answer: D. Use the Amazon Simple Queue Service (Amazon SQS) queue and Lambda to buffer writes to DynamoDB.
Explanation
To address the availability issues and prevent the loss of user requests in the given scenario, a solutions architect should choose option D: Use the Amazon Simple Queue Service (Amazon SQS) queue and Lambda to buffer writes to DynamoDB. Here's how this solution helps: 1. Amazon Simple Queue Service (Amazon SQS): SQS is a fully managed message queuing service that decouples the ingestion of user requests from the processing microservices. It acts as a buffer to store the requests before they are processed, providing reliable and scalable message queuing. 2. AWS Lambda: Use Lambda to process the messages from the SQS queue. Lambda functions can be triggered automatically whenever new messages are available in the queue, allowing for seamless integration with the existing architecture. By implementing this solution, the company gains the following benefits: - Increased availability: By buffering the writes to DynamoDB using SQS, the company can handle bursty loads and smooth out any spikes in request rates. This reduces the chances of availability issues and prevents the loss of user requests. - Scalability: SQS provides automatic scaling and high reliability, ensuring that the requests are reliably stored and processed even during peak times. It decouples the ingestion and processing components, allowing them to scale independently. - Fault tolerance: If the processing microservices are temporarily unavailable, the requests will be safely stored in the SQS queue until they can be processed. This ensures that no requests are lost and that they are processed in the order they were received. Option A suggests adding throttling on the API Gateway with server-side throttling limits. While this can help control the request rate, it does not address the underlying issue of availability and potential loss of user requests. Option B suggests using DynamoDB Accelerator (DAX) and Lambda to buffer writes to DynamoDB. While DAX can improve the read performance of DynamoDB, it does not address the availability issues or prevent the loss of user requests. Option C suggests creating a secondary index in DynamoDB for the label with the user requests. While secondary indexes can improve query performance, they do not directly address the availability issues or prevent the loss of user requests.