Rob Morris
3 min readOct 28, 2022

--

TL; DR:

Serverless architecture, or serverless computing, is a cloud-based model where machine resources are on demand, and the cloud provider takes care of all work required by that resource, leaving the customer the ability to focus only on implementation.

In AWS, there is a host of serverless compute models that include Lambda, Aurora, API Gateway, DynamoDB, S3, Kinesis, Fargate, and more, with new serverless features coming out almost monthly.

While Lambda is the most often talked about serverless feature in AWS, other excellent cloud-based serverless tools are becoming mainstream in cloud-based designs from AWS.

Amazon SNS

While Amazon SNS (Simple Notification Service) is one of the older services in AWS (2010), it maintains a strong use case for creating separate or loosely coupled elements of a team’s architecture. Amazon SNS addresses the 1-to-1 issue with another Amazon service SQS (Simple Queue Service). Amazon SQS was created right after Amazon S3 in 2006 and allows users to create a decoupled event-based environment where a message is published to a queue then a single consuming application can process that message immediately or later.

Lambda and Amazon SNS are often utilized together when building highly scalable architectures. SNS enables you to create event-driven software applications through a pub/sub model and many-to-many messaging.

SNS also supports multiple topic models, which include the standard model for messages that arrive more than once and out of order and FIFO for ordered-based messaging.

Amazon SNS is capable of high-throughput messaging that enables publishers to push messages to many subscribers for parallel processing. A nearly unlimited rate of messages per second for standard topics is supported.

Out-of-the-box SNS supports many connections, including Amazon SQS, Amazon Kinesis Data Firehouse, AWS Lambda, HTTPS, and more. It also supports application-to-person endpoints right out of the box, including SMS mobile push and email. As a side note, FIFO topics only support messages delivered to Amazon SQS FIFO queues.

Use Case

Let’s look at a widespread use case.

A common design for using Amazon SNS and Amazon EventBridge in a retail ordering system.
Amazon SNS Order System

When building a retail order service, you want to be able to utilize real-time order data for multiple purposes. First and foremost, you want to process that order through some order processing system using various steps (Amazon Step Functions) and then return shipping, completed transaction data, etc. You need to store the data and potentially send it to a warehouse for processing. Finally, you want to utilize Amazon Personalize to take advantage of advanced AI to increase your marketing power in real time. For instance, if you have a product or group of products that are “hot” one day, you want to dynamically push those products to the top of your website or make personalized recommendations to other customers based on that data.

Amazon SNS enables you to decouple all that work in an event-based system by pushing that order “message” off to systems that subscribe to the order queue.

Summary

While Amazon SNS is an older serverless service in the AWS Cloud architecture, it is still one of the most used tools in today’s event-driven architectures. Often used with other serverless tools such as Amazon EventBridge, Amazon SQS, and Amazon Lambda, it can connect your data to a wide range of sources in a loosely coupled design that allows you to change and grow with your industry and architecture.

--

--

Rob Morris

Coffee drinker and Technical Architect for one of the largest consulting firms in the world.