SNS
Simple Notification Service
ELI5 — The Vibe Check
SNS is a pub/sub messaging service. One thing publishes a message (like 'new order placed!') and SNS broadcasts it to everyone who's subscribed — email, SMS, Lambda functions, SQS queues, all at once. It's like a group chat where one message goes to every subscriber simultaneously.
Real Talk
Amazon SNS is a fully managed pub/sub messaging service for fan-out patterns. Publishers send to topics; SNS delivers to all subscribers (Lambda, SQS, HTTP endpoints, email, SMS, mobile push). Used for event-driven architectures where one event must trigger multiple downstream actions.
Show Me The Code
// Publish to an SNS topic
import { SNSClient, PublishCommand } from '@aws-sdk/client-sns';
const client = new SNSClient({ region: 'us-east-1' });
await client.send(new PublishCommand({
TopicArn: 'arn:aws:sns:us-east-1:123:OrderEvents',
Message: JSON.stringify({ type: 'ORDER_PLACED', orderId: '789' }),
Subject: 'New Order'
}));
When You'll Hear This
"When a payment completes, we publish to SNS and three services get notified." / "SNS fans out to both SQS and a Lambda for different processing."
Related Terms
AWS (Amazon Web Services)
AWS is like a giant magical warehouse where you can rent computers, storage, databases, and basically anything tech-related — by the minute.
Lambda
AWS Lambda is where you upload a function and AWS runs it when something happens — an HTTP request, a file upload, a database change.
Pub/Sub (Pub/Sub)
Pub/Sub is like a newspaper service. Publishers write articles and drop them off.
SQS (Simple Queue Service)
SQS is a message queue in the cloud. One part of your app puts messages in the queue, another part picks them up and processes them later.