A monolithic application calls an image-processing routine synchronously inside each web request. When the image routine slows down under load, request threads block waiting for it and the whole web tier becomes unresponsive, causing cascading failures. The team wants to decouple image processing so a slow or failing processor cannot stall the web tier, while ensuring no submitted image is lost if the processor is temporarily down. Which design best achieves this?
- AHave the web tier publish each image job to an Amazon SNS topic that pushes the job directly to the processor over an HTTP subscription so processing happens out of the request path.
- BHave the web tier publish each image job to an Amazon SQS queue and run the processor as a separate consumer fleet that polls the queue and scales on its depth. Correct
- CIncrease the web tier request timeout and add more threads so the application can hold many concurrent requests open while the image routine catches up under heavy load.
- DMove the image routine into an AWS Lambda function and have the web tier invoke it synchronously with the RequestResponse invocation type for every incoming request.
Why A is wrong: SNS is fire-and-forget push without durable buffering, so if the processor is down the delivery fails and the image is lost, which violates the no-lost-jobs requirement even though it does move work off the request path.
Why B is correct: An SQS queue buffers jobs durably so the web tier returns immediately and a slow or down processor only lengthens the queue, removing the synchronous blocking and preventing job loss while the consumer catches up.
Why C is wrong: More threads and longer timeouts keep the synchronous coupling in place, so a slow processor still exhausts resources and stalls the web tier; this masks the symptom rather than decoupling the components.
Why D is wrong: A synchronous RequestResponse Lambda invocation still blocks the web request until processing finishes, so it reproduces the same cascading stall when the function is slow and provides no durable buffer.