Skip to content

Instantly share code, notes, and snippets.

@nikkaroraa
Created September 25, 2020 08:36
Show Gist options
  • Save nikkaroraa/95c44f19d20e0b650cad374c50337259 to your computer and use it in GitHub Desktop.
Save nikkaroraa/95c44f19d20e0b650cad374c50337259 to your computer and use it in GitHub Desktop.
Amazon SNS (Simple Notification Service)

Amazon SNS

  • The "event producer" only sends message to one SNS topic
  • As many "event receivers" (subscriptions) as we want to listen to the SNS topic notifications
  • Each subscriber to the topic will get all the messages (note: new feature to filter messages)
  • Up to 10,000,000 subscriptions per topic
  • 100,000 topics limit
  • Subscribers can be:
    • SQS
    • HTTP/HTTPs (with delivery retries - how many times)
    • Lambda
    • Emails
    • SMS messages
    • Mobile notifications

SNS + SQS: Fan Out

  • Publish once in SNS, receive in all SQS queue that are subscribers
  • Fully decoupled, no data loss
  • SQS allows for:
    • data persistence
    • delayed processing
    • retries of work
  • Ability to add more SQS subscribers over time
  • Make sure your SQS queue access policy allows for SNS to write to the queue
  • SNS cannot send messages to SQS FIFO queues (AWS limitation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment