Question #950
A company operates a web application leveraging Amazon API Gateway, AWS Lambda, and Amazon DynamoDB. A sudden spike in user traffic has led to increased latency. Monitoring reveals that 18% of requests result in errors. The CloudWatch metrics indicate Lambda throttles account for 0.5% of requests, while Lambda errors are at 12%. Application logs show that errors coincide with DynamoDB operations.
What should the solutions architect recommend to enhance performance and reduce errors as traffic grows?
Adjust API Gateway's rate limiting settings.
Modify the DynamoDB table's primary key structure.
Raise the Lambda function's concurrency limit.
Enable DynamoDB auto scaling for the table.
Explanation
The correct answer is B: Enable DynamoDB auto scaling for the table.
Why B is correct:
- The application logs indicate errors during DynamoDB operations, suggesting DynamoDB throttling due to insufficient provisioned throughput. Auto scaling dynamically adjusts the table's capacity to match traffic, reducing throttling errors and improving performance.
Why other options are incorrect:
- A: Raising Lambda's concurrency limit addresses Lambda throttling (0.5% of errors) but not the 12% Lambda errors tied to DynamoDB.
- C: Adjusting API Gateway rate limiting would restrict traffic instead of scaling resources to handle growth.
- D: Changing the primary key structure addresses data access patterns, not scaling issues caused by traffic spikes.
Key Points:
- DynamoDB auto scaling prevents throttling by adjusting capacity.
- Lambda errors linked to DynamoDB indicate database bottlenecks, not Lambda configuration.
- Auto scaling is critical for handling unpredictable traffic in serverless architectures.
Answer
The correct answer is: B