Advantage of Publishing Message to SNS rather directly pushing to SQS
Asked Answered
B

1

5

I am currently building a microservices based backend for my E-Commerce Setup

I need to push all the transactions to a Queue Service, but AWS documentation says that I should publish my message to SNS and then subscribe my queue to a topic

but in SQS documentation there is also a way to send message directly to SQS

*PS: I have already searched stackoverflow but none of the question answers for my specific use case so why are there two solutions for the same thing and need to use SNS and pay extra money

Bloodstream answered 24/8, 2021 at 8:54 Comment(0)
A
6

One reason for that is that you can very easily scale your architecture if you publish to SNS first. This is due to being able to implement fanout scenario:

enter image description here

Now you may only need your msg in a single SQS queue. But later you may want to add second one to process same messages, also maybe invoke some lambda functions independently from your queue, or send them as well to some HTTP endpoint.

Anthelmintic answered 24/8, 2021 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.