Diagram
Comments
- The queue decouples request intake from processing. If Lambda is slow or fails, messages wait in SQS instead of being lost.
- The dead-letter queue (DLQ) receives messages that fail repeatedly, so you can review them without blocking the main queue.
- SQS Standard delivers each message at least once and does not guarantee order. If order or deduplication matters, use SQS FIFO.
- Lambda can use reserved concurrency so it does not overwhelm the database or downstream services.
Information flow
- Amazon API Gateway
The client sends the request to API Gateway.
- Amazon SQS
API Gateway puts the message in the queue and responds without waiting for processing.
- AWS Lambda
Lambda consumes messages from the queue in batches and runs the business logic.
- Amazon DynamoDB
Lambda stores the result in DynamoDB.
- Amazon SNS
Lambda publishes an event to SNS to notify subscribers, such as email or HTTP endpoints.
- Dead-letter queue
If a message fails more times than allowed, SQS moves it to the DLQ for review.