How to Throttle Third-Party API Calls in Serverless Architecture?
Short answer
B Configure the REST API in API Gateway to write the requests directly into an Amazon Simple Queue Service (Amazon SQS) queue. Configure the Lambda function with a reserved concurrency equal to the third-party stock application's threshold. Set Lambda function to process the messages from the SQS queue.
Question
Key Takeaways
Evaluates your understanding of event-driven buffering and concurrency controls to prevent downstream service overload, often tricked by confusing throttling mechanisms with capacity provisioning.
This scenario tests decoupling API Gateway from direct Lambda execution using Amazon SQS to manage traffic spikes and protect external endpoints. The community unanimously agrees that pairing an SQS buffer with Lambda reserved concurrency is the optimal solution for rate-limiting.
Common mistake: Option C is frequently selected due to its use of SNS, but provisioned concurrency only guarantees warm instances rather than actively throttling invocation rates, making it ineffective for preventing API overload.
Expert Analysis
Why the Answer Is Correct
Using Amazon SQS as a buffer between API Gateway and Lambda effectively absorbs traffic spikes while maintaining system stability. Configuring reserved concurrency on the Lambda function strictly caps the number of simultaneous executions to match the third-party API's safe threshold. This architecture ensures requests are processed at a controlled pace, preventing timeouts or errors from the external service.
Why the Other Options Are Wrong
Option A relies on DynamoDB streams, which lack native concurrency throttling and would still trigger uncontrolled Lambda invocations during peak loads. Option C utilizes SNS with provisioned concurrency, but provisioned concurrency reserves capacity rather than enforcing rate limits, failing to address the overload requirement. Option D incorrectly applies Athena, an analytical query service, to real-time transactional workflows, introducing unacceptable latency and architectural mismatch.
Community Comment Notes
Candidates overwhelmingly validate option B as the industry-standard pattern for this certification objective. Contributors emphasize the decoupled flow where API Gateway writes to SQS, allowing Lambda to poll and process messages safely. Multiple users note that this exact configuration aligns with AWS best practices for handling unpredictable traffic and external dependency limits.
Official Reference
- https://docs.aws.amazon.com/lambda/latest/dg/limits.html#reserved-concurrency
- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
- https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-sqs.html
These links open the official vendor documentation in a new tab.
Exam Strategy
When a question emphasizes protecting third-party APIs or managing peak traffic, prioritize message queuing solutions paired with explicit concurrency limits. Always distinguish between reserved concurrency, which actively throttles invocations, and provisioned concurrency, which merely pre-warms capacity without controlling throughput.
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
tgv 👍 11B should do it: API Gateway --> SQS <-- Lambda poll
-
CrescentShared 👍 5 Answered Bno doubt.
-
seetpt 👍 2 Answered BB is right
-
65703c1 👍 1 Answered BB is the correct answer.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →