AWS Certified Solutions Architect - Professional / Question #551 of 529

Question #551

A social media platform uses Amazon API Gateway, AWS Lambda, and Amazon DynamoDB for its backend services. Users have reported intermittent errors during POST requests, especially during peak hours. Investigation reveals that a few clients with high traffic are responsible for the majority of the errors. The platform's operations team notes that the errors are directly shown to end-users, leading to a poor user experience. The platform can tolerate occasional retries but needs to prevent user-facing errors.

What should the solutions architect do to mitigate this issue?

A

Implement retry logic with jitter and exponential backoff in the client SDK, ensuring errors are logged but not shown to users.

B

Configure API throttling using a usage plan in API Gateway and update clients to handle 429 HTTP status codes gracefully.

C

Enable DynamoDB auto-scaling to adjust capacity based on the traffic load and implement a backoff strategy in the Lambda functions.

D

Set up reserved concurrency for the Lambda functions to ensure consistent performance during traffic spikes.

Explanation

The issue stems from a few high-traffic clients overwhelming the backend during peak hours. Option B addresses this by using API Gateway's throttling via usage plans to enforce rate limits, returning 429 errors when clients exceed their quota. Updating clients to handle 429s with retries (e.g., exponential backoff) prevents user-facing errors.

Option A relies solely on client-side retries, which may exacerbate backend load. Option C focuses on DynamoDB scaling, which may not resolve throttling caused by API-level overload. Option D's reserved concurrency limits Lambda scaling but doesn't address client-specific traffic spikes. Throttling at the API Gateway layer (B) is the most direct and effective solution to control traffic and improve user experience.

Answer

The correct answer is: B