4 ms·
Curious a/your use case or two for the “fan out” capability here. Do you mind sharing?
by social_quotient 8y ago
Curious a/your use case or two for the “fan out” capability here. Do you mind sharing?
- scarface74 8y ago1. You can have one SNS topic, send messages to it with attributes and subscribe to different targets based on the attribute. 2. You can have one SNS message go to different targets. There may be more than one consumer interested in an event. 3. “Priority” processing. I can have the same lambda function subscribed to both an SQS queue and an SNS topic. We do some things in batch where the message will go to SNS -> SQS -> lambda. But with messages with a priority of “high” they will go directly from SNS -> Lambda but they will also go through the queue. High priority messages are one off triggered by a user action.
- otterley 8y agoBy “fan out” I mean that SNS will execute as many Lambda functions as needed to handle the published events as they occur. This gives you much greater concurrency than a typical pub/sub architecture where you typically have a ceiling on the subscriber count or are forced to wait on consumers to process the earlier enqueued messages before processing subsequent ones (i.e., the head-of-line blocking problem).