diff --git a/README.md b/README.md index d9e670a..35874e8 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Table of Contents | [OpsWorks](#opsworks) | [πŸ“—](#opsworks-basics) | [πŸ“˜](#opsworks-tips) | [πŸ“™](#opsworks-gotchas-and-limitations) | | [Batch](#batch) | [πŸ“—](#batch-basics) | [πŸ“˜](#batch-tips) | | [SQS](#sqs) | [πŸ“—](#sqs-basics) | [πŸ“˜](#sqs-tips) | [πŸ“™](#sqs-gotchas-and-limitations) | +| [SNS](#sns) | [πŸ“—](#sns-basics) | [πŸ“˜](#sns-tips) | [πŸ“™](#sns-gotchas-and-limitations) | **Special Topics** @@ -1938,6 +1939,7 @@ SQS - Alternatives to SQS include [Kafka](https://kafka.apache.org/), [RabbitMQ](https://www.rabbitmq.com/), [ActiveMQ](http://activemq.apache.org/) and others. - Google Cloud Platform has Pub/Sub, and Azure has Azure Queue Service. +- [SQS vs SNS](#sns-alternatives-and-lock-in) ### SQS Tips @@ -1955,6 +1957,44 @@ SQS - πŸ”Έ SQS cannot be directly used as a trigger for Lambda functions. +SNS +--------------------- + +### SNS Basics + +- πŸ“’ [_Homepage_](https://aws.amazon.com/sns/) βˆ™ [_Documentation_](https://aws.amazon.com/documentation/sns/) βˆ™ [_FAQ_](https://aws.amazon.com/sns/faqs/) βˆ™ [_Pricing_](https://aws.amazon.com/sns/pricing/) +- **Amazon SNS** (Simple Notification Service) is a pub/sub based, highly scalable, and fully managed messaging service that can also be used for mobile notifications. +- SNS can push the messages down to the subscribers via [SMS](http://docs.aws.amazon.com/sns/latest/dg/SMSMessages.html), [Email](http://docs.aws.amazon.com/sns/latest/dg/SubscribeTopic.html), [SQS](http://docs.aws.amazon.com/sns/latest/dg/SendMessageToSQS.html), and [HTTP/S](http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html) transport protocols. +- Producers publish messages to a SNS Topics, which can have many subscribers. +- Each subscription has an associated [protocol](http://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html), which is used to notify the subscriber. +- A copy of the message is sent to each subscriber using the associated protocol. +- SNS can also [invoke lambda functions](http://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html). + +### SNS Alternatives and Lock-In + +- Popular alternatives to SNS are [Kafka](https://kafka.apache.org/), [Notification Hubs](https://azure.microsoft.com/en-us/services/notification-hubs/) on Azure, and [Pub/Sub](https://cloud.google.com/pubsub/docs/overview) on Google Cloud. +- **SNS vs SQS:** + - Both SNS and SQS are highly scalable, fully managed messaging services provided by AWS. + - SQS supports a *pull* model, while SNS supports a *push* model. Consumers have to pull messages from an SQS Queue, while they're pushed the message from an SNS Topic. + - An SQS message is intended to be processed by only one subscriber, while SNS topics can have many subscribers. + - After processing, the SQS message is deleted from the queue by the subscriber to avoid being re-processed. + - An SNS message is *pushed* to all subscribers of the topic at the same time, and is not available for deletion at the topic. + - SNS supports multiple transport protocols of delivery of the messages to the subscribers, while SQS subscribers have to pull the messages off the queue over HTTPS. + - SNS can be used to trigger lambda functions, while SQS cannot. + +### SNS Tips + +- [Fan-out](http://docs.aws.amazon.com/sns/latest/dg/SNS_Scenarios.html) architecture can be achieved by having multiple subscribers for a topic. This is particularly useful when events have to be fanned out to multiple, isolated systems. +- SNS topics can be used to power [webhooks](https://en.wikipedia.org/wiki/Webhook) with [backoff support](http://docs.aws.amazon.com/sns/latest/dg/DeliveryPolicies.html) to subscribers over HTTP/S. +- [SQS queues](http://docs.aws.amazon.com/sns/latest/dg/SendMessageToSQS.html) can subscribe to SNS topics. +- SNS is used to manage notifications for other AWS services like [Autoscaling Groups](http://docs.aws.amazon.com/autoscaling/latest/userguide/ASGettingNotifications.html)' notifications, [CloudWatch Alarms](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/US_SetupSNS.html), etc. +- SNS is frequently used as β€œglue” between disparate systemsβ€” such as GitHub and AWS services. + +### SNS Gotchas and Limitations + +- πŸ”Έ HTTP/S subscribers of SNS topics need to have public endpoints, as SNS does not support calling private endpoints (like those in a private subnet within a VPC). + + High Availability -----------------