Good for fan-out. For ingestion I now put SQS in the path so Lambda can batch.
Use it when
- One event must reach several queues, functions or emails.
Don't use it when
- High-volume ingestion straight into Lambda (one invocation per message). Put SQS in the path and batch.
In my words: what hurts
- I've used it for data ingestion, especially IoT, and don't trust it at very high message rates.
Gotchas, with fixes
Gotcha: SNS → Lambda invokes a function per message: at IoT volumes that's millions of tiny invocations.
Fix: SNS → SQS → Lambda with batching, or skip SNS and write straight to SQS.
Provisioning
Official Pulumi package · Official Terraform provider
@pulumi/aws sns.Topic and TopicSubscription.
Instead, consider
- Amazon SQS Ingestion and anything that needs batching.
- Amazon EventBridge Routing by event content.
Worked examples
Where it fits
- Event-driven plumbing: Pick 03.
Fan-out: one event to several queues or functions.
- Device and IoT data: Don't.
SNS invokes Lambda once per message: at device volumes that's millions of tiny invocations. SQS lets Lambda take them in batches.
Instead: Amazon SQS
Last reviewed by Nicolas Dao