I'm currently facing a problem when thinking about a event driven arch using SNS to decouple some applications.
Imagine a SNS Topic, and I have application A producing messages to it and application B will listen and consume messages from this topic.
This application B has a autoscaling group attached to it, so it can scales to more than one instance. How will SNS handle when application B scales? If now I got 2 instances of application B, SNS will send the message for all of them or it can realize that they are the same application and just send the message to one of them?
Think of SNS
as a radio broadcast: Everyone who is listening will get your message. Meaning that every single of your subscribed servers will get notified.
SQS
, on the other hand, is more like a todo list. Many subscribers can also listen to it, but every message is distributed to at least someone
. Meaning that usually, only one server will get triggered.
If that suits you better, then you might consider using SQS instead of SNS.