Simple Pub/Sub & Fan-Out

In this chapter, you will implement and observe the Pub/Sub (Publish/Subscribe) and Fan-Out messaging patterns using Amazon SNS and Amazon SQS.

In a Fan-Out pattern, a message published to a single SNS topic is automatically cloned and delivered in parallel to multiple endpoints. In our coffee shop scenario, a customer order is broadcast simultaneously to:

  • Customer Email: Sends an immediate order confirmation receipt.
  • BaristaQueue (Amazon SQS): Buffers the order for coffeehouse baristas to brew asynchronously.

Pub/Sub Pattern Overview