Here are a few things I can think of:
- Batching: SQS uses batching to aggregate multiple events before invoking a Lambda function invocation. This can speed up processing by reusing hot code, reducing the number of Lambda function invocations (thus amortizing cold start overhead), and reducing the chance of encountering Lambda function execution concurrency limits. However, there is a possible latency tradeoff: if the event frequency is low, SQS may wait up to 20 seconds before flushing pending messages to Lambda.
- Observability: With SQS you can easily observe the length of the backlog of events that have not been processed by your Lambda function or that have failed processing. This can be useful for determining whether something is going wrong.
You will get the following benefits by using SQS : -
- helps in the retry mechanism if the lambda process fails.
- routes the messages to Dead Letter Queue after the retry limit is reached, which enables you to process them at a later time within the next 14 days(maximum). i.e persistent
- If you want to maintain the order of the messages then you can go with SQS FIFO.
- Multiple subscribers can poll from the same SQS, but a message can be processed only by 1 subscriber, unlike SNS. In the SNS scenario, as it is a push mechanism, all the subscribers can consume the message and trigger their own processes.
- SQS primarily used for decoupling sending and receiving components.
In case of SNS to Lambda:-
- It is good for time-critical processes
SNS -> SQS -> Lambda is a better approach if you need a Fan-Out De-coupled solution.
Subscribe-Success message is not getting received into SQS from SNS topic while integrating AWS Marketplace SaaS product with Contract pricingasked 3 months ago
What is wrong with calling DescribeMatchmaking vs polling a SNS topicAccepted Answerasked 3 years ago
How to use SNS or SQS on Unreal with FlexMatchasked 3 years ago
SNS to Lambda vs SNS to SQS to LambdaAccepted Answerasked a year ago
Cloudformation: connect lambda to an exisitng SNS topic ?asked 3 years ago
General AWS SNS subscription to GovCloud SQS - ARN Validation Failsasked 3 years ago
While trying to create an SNS subscription, after choosing a topic, all protocols except SQS disappearasked 6 months ago
How to create subscription from an SNS to another SNSAccepted Answerasked 7 months ago
Do we need VPC Endpoints for SNS and SQS if data not originating from any VPC and directly landing in SNS from external sourceasked 10 months ago
SQS not receiving SNS messageasked 3 years ago