AWS Certified Solutions Architect – Professional — Question 623
A software company has deployed an application that consumes a REST API by using Amazon API Gateway, AWS Lambda functions, and an Amazon
DynamoDB table. The application is showing an increase in the number of errors during PUT requests. Most of the PUT calls come from a small number of clients that are authenticated with specific API keys.
A solutions architect has identified that a large number of the PUT requests originate from one client. The API is noncritical, and clients can tolerate retries of unsuccessful calls. However, the errors are displayed to customers and are causing damage to the API's reputation.
What should the solutions architect recommend to improve the customer experience?
Answer options
- A. Implement retry logic with exponential backoff and irregular variation in the client application. Ensure that the errors are caught and handled with descriptive error messages.
- B. Implement API throttling through a usage plan at the API Gateway level. Ensure that the client application handles code 429 replies without error.
- C. Turn on API caching to enhance responsiveness for the production stage. Run 10-minute load tests. Verify that the cache capacity is appropriate for the workload.
- D. Implement reserved concurrency at the Lambda function level to provide the resources that are needed during sudden increases in traffic.
Correct answer: B
Explanation
Implementing API throttling with a usage plan in Amazon API Gateway allows the system to limit the rate of requests from the specific client causing the traffic spike using their API key. Handling the resulting HTTP 429 (Too Many Requests) status codes gracefully in the client application prevents disruptive error messages from being shown to users. Other options, like reserved concurrency (D) or caching (C), do not address the client-specific throttling needs, and client-side retries with error messages (A) still expose errors to the users.