A payment API sometimes fails when the downstream invoice-generation service is overloaded or unavailable. Orders must not be lost. Which change makes the architecture resilient?
A.Increase the API timeout so requests wait longer
Longer timeouts still fail when the downstream service is down and waste resources.
B.Place an SQS queue between the API and the invoice service so requests are durably buffered
Correct. The queue durably buffers work until the consumer recovers.
C.Move both components onto the same EC2 instance
Co-locating components couples them further and removes independent scaling.
D.Add a CloudFront distribution in front of the API
CloudFront caches content; it does not buffer transactional requests.
Why this answer
An SQS queue decouples the producer from the consumer: messages persist durably until the invoice service can process them, absorbing spikes and downstream outages. This is the classic loose-coupling pattern the exam favors.
Correct answer: B · Last reviewed 2026-10-25
Official AWS references
Practice this interactively
Answer without seeing the solution first in the Decoupling & Messaging practice session.
Practice Decoupling & Messaging