Skip to main content

03. Amazon SNS (Simple Notification Service)

Amazon SNS (Simple Notification Service) enables asynchronous, one-to-many (Pub/Sub) messaging between distributed systems and microservices. It allows a single message to be broadcast to multiple subscribers instantly ideal for notifications and fan-out messaging.

When one service needs to send the same message to multiple receivers, direct integrations can get messy.

Instead of connecting to each service individually, we use SNS Topics.

IAM Roles Example

⚙️ How It Works

ComponentRole
Publisher (Producer)Sends a message to an SNS Topic.
TopicActs as a central hub for distributing messages.
Subscribers (Consumers)Receive messages from the topic, all subscribers get a copy.

✅ One publisher → many subscribers.
✅ Each subscriber gets all messages.
✅ No need for multiple direct integrations.


🌐 Example Use Case

Scenario: An e-commerce platform where the Buying Service needs to notify multiple systems.

DestinationDescription
Email ServiceSends order confirmation email.
Fraud ServiceChecks order legitimacy.
Shipping ServiceStarts shipment preparation.
SQS QueueSends order info for further processing.

✅ All notifications sent simultaneously from a single publish action.


⚡ Scalability & Limits

FeatureValue
Subscribers per TopicUp to 12 million
Topics per AccountSoft limit of 100,000
Destinations SupportedSQS, Lambda, Firehose, Email, SMS, Mobile Push, HTTP/S Endpoints
LatencyNear real-time (milliseconds)
Delivery RetriesAutomatic for supported protocols

🧠 Exam Tips

KeywordThink Of
NotificationSNS
Pub/Sub modelSNS
Fan-out patternSNS
Broadcast to multiple systemsSNS
One-to-many communicationSNS

🔁 SNS vs SQS Comparison

FeatureSQS (Queue)SNS (Topic)
ModelPoint-to-PointPublish/Subscribe
Message DeliveryDelivered to one consumer instanceDelivered to all subscribers
PersistenceMessages stored until processedMessages pushed immediately
Use CaseDecouple producer and consumerBroadcast events to multiple receivers
ExampleOrder processing queueSend “OrderPlaced” to Email, SMS, Billing services

🧩 Fan-Out Pattern

SNS and SQS are often used together — SNS sends a message to multiple SQS queues.

Reliable and scalable broadcast
✅ Each service processes messages independently
✅ Perfect for decoupled microservice architectures


🧠 Key Takeaway

Amazon SNS allows a single message to be instantly broadcast to multiple subscribers

Ideal for notifications, alerts, and fan-out integration patterns.

Think "Publish/Subscribe" whenever you need one-to-many communication.


SNS Hands On

  1. Create Topic (Email is subscribe here)
IAM Roles Example
  1. Publishing message works
IAM Roles Example

🔹 SQS → Pull model (polling required) 🔹 SNS → Push model (automatic delivery)