Amazon SNS is a serverless service that allows you to send and receive notifications. It uses the publish/subscribe model, where messages can be published to a topic and sent to all subscribers.
In a fanout architecture, any message published on an SNS topic is replicated and sent to multiple subscriber endpoints, which allows parallel asynchronous processing. This means a single message can be sent to different endpoints, such as SQS queues and Lambda functions, where it will be used for further processing.
In this Cloud Lab, you’ll see how the fanout architecture works in Amazon SNS. To do this, you’ll first create a topic using Amazon SNS and then create two Amazon SQS queues. You’ll add these queues as subscribers to your topic. After this, you’ll create two Lambda functions that will be invoked when your queues receive messages from the SNS topic. Finally, you’ll view your functions’ metrics in CloudWatch.
After completing this Cloud Lab, you’ll have a thorough understanding of the fanout architecture in Amazon SNS and will be able to filter the messages sent by it.
The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab: