Home > Net >  Can you let your application fan-out instead of SNS fan-out?
Can you let your application fan-out instead of SNS fan-out?

Time:04-27

I currently have an application that sends messages to the SNS topic. And there are three SQS queues that are subscribed to the topic. I am trying to eliminate the usage of SNS from my architecture because of cost. Is it possible that my application itself acts like SNS and fan-out messages to SQS without the usage of SNS? If there are any drawbacks, what are those?

CodePudding user response:

Of course you can have your application do that, SNS is just calling the sqs:SendMessage API under the hood as well and makes sure it gets a positive response, but there are significant drawbacks:

  • You have to maintain the list of queues to send messages to and thereby introduce close coupling
  • You have to ensure a message gets sent to all queues and handle retries in case of intermittent API failures

Sending messages to one SNS topic is most likely faster and less complex than writing and maintaining the code to do that for an arbitrary number of SQS queues.

SNS has a price, but so do developers. Building and maintaining your own solution has a cost - initial and ongoing. If that makes sense from a business perspective, go for it.

  • Related