
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A company owns an asynchronous API that is used to ingest user 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 Lambda to buffer writes to DynamoDB.
C
Create a secondary index in DynamoDB for the table with the user requests.
D
Use the Amazon Simple Queue Service (Amazon SQS) queue and Lambda to buffer writes to DynamoDB.
Explanation:
Correct Answer: D - Use the Amazon Simple Queue Service (Amazon SQS) queue and Lambda to buffer writes to DynamoDB.
Problem Analysis: The company is experiencing availability issues and losing user requests despite provisioning maximum DynamoDB throughput within budget constraints. This indicates that the system is hitting throughput limits during peak loads.
SQS as a Buffer: Amazon SQS provides a reliable, fully managed message queuing service that can act as a buffer between API Gateway/Lambda and DynamoDB. When DynamoDB is at capacity, messages can be queued in SQS and processed asynchronously when capacity becomes available.
Decoupling Architecture: By introducing SQS, the system becomes more resilient:
Cost-Effective Solution: SQS is cost-effective and doesn't require upfront provisioning like DynamoDB throughput. It scales automatically based on demand.
A. Add throttling on the API Gateway: This would reject user requests at the API level, which contradicts the requirement "without impacting existing users." Throttling would cause user requests to fail.
B. Use DynamoDB Accelerator (DAX): DAX is a caching layer for DynamoDB that improves read performance, but it doesn't help with write throughput limitations. The problem is write capacity, not read performance.
C. Create a secondary index: Secondary indexes in DynamoDB help with query flexibility but don't increase write throughput capacity. They actually consume additional write capacity units when data is written to the main table.
This solution implements the common AWS pattern: API Gateway → Lambda → SQS → Lambda → DynamoDB, which provides: