link: AWS, Message Queues

AWS SQS

Overview

AWS Simple Queue Service (SQS) is a fully managed message queuing service provided by AWS that enables decoupling and scaling of microservices, distributed systems, and serverless applications. SQS allows you to send, store, and receive messages between software components without losing messages or requiring other services to be available.

Key Features

Summary

  • Message Queuing: SQS allows for reliable and scalable message queuing, ensuring that messages are delivered and processed asynchronously.
  • Multiple Queue Types: Supports Standard and FIFO (First-In-First-Out) queues to cater to different application requirements.
  • Scalability: Automatically scales to handle high throughput of messages.
  • Security: Provides message encryption, access control, and policies to secure data and ensure reliable delivery.

How It Works

  1. Queues: Create a queue that acts as a storage for messages until they are processed.
  2. Message Sending: Producers send messages to the SQS queue.
  3. Message Storage: SQS stores the messages in the queue.
  4. Message Receiving: Consumers retrieve messages from the queue and process them.
  5. Message Deletion: After processing, consumers delete the messages from the queue to prevent reprocessing.

Combining With SNS

Combining with SQS

Combining Amazon SNS with AWS SQS leverages the power of publishing to multiple recipients with the durability of queues. This integration is beneficial for creating robust, scalable messaging solutions.

Architecture Overview

message broker architecture

How It Works:

  1. Publisher: Sends messages to the Amazon SNS topic.
  2. SNS Topic: Replicates and sends the received message to all its subscribers.
  3. Subscribers: Amazon SQS queues act as subscribers to the SNS topic.
  4. Consumers: Applications or services pull messages from the SQS queues.

This solution guarantees that messages are delivered to applications requiring immediate notifications for some events. They are also persistent, thanks to the queues, and can wait there until a consumer is available.

Link to original