2.5 Decoupling with SQS, SNS, and EventBridge

Key Takeaways

  • SQS provides point-to-point message queuing with at-least-once delivery; use it to decouple producers from consumers and absorb traffic spikes.
  • SNS provides pub/sub messaging that fans out messages to multiple subscribers (SQS queues, Lambda, HTTP endpoints, email).
  • EventBridge is a serverless event bus that routes events from AWS services, custom applications, and SaaS partners based on rules.
  • SQS Standard queues offer unlimited throughput with best-effort ordering; FIFO queues guarantee exactly-once processing and strict ordering (3,000 messages/second with batching).
  • The fan-out pattern (SNS → multiple SQS queues) is the most common decoupling architecture on the SAA-C03 exam.
Last updated: March 2026

Decoupling with SQS, SNS, and EventBridge

Quick Answer: SQS = message queue (one producer, one consumer). SNS = pub/sub (one message to many subscribers). EventBridge = event bus (rule-based routing from many sources to many targets). Use the SNS+SQS fan-out pattern for one-to-many reliable message delivery.

Why Decouple?

Tightly coupled systems have a single point of failure — if one component fails, the entire system fails. Decoupling ensures:

  • Resilience — Producer and consumer can operate independently
  • Scalability — Each component scales independently
  • Flexibility — Components can be updated or replaced without affecting others
  • Reliability — Messages are not lost when consumers are temporarily unavailable

Amazon SQS (Simple Queue Service)

SQS is a fully managed message queuing service that enables decoupling and scaling of microservices, distributed systems, and serverless applications.

SQS Standard vs. FIFO

FeatureStandard QueueFIFO Queue
ThroughputUnlimited3,000 msg/sec (with batching), 300 without
OrderingBest-effort (may be out of order)Strict FIFO ordering
DeliveryAt-least-once (possible duplicates)Exactly-once processing
NamingAny nameMust end in .fifo
Use caseHigh throughput, order not criticalFinancial transactions, order processing

Key SQS Concepts

ConceptDescription
Visibility TimeoutTime a message is hidden from other consumers after being received (default 30s, max 12 hours)
Long PollingConsumer waits for messages (up to 20 seconds) — reduces API calls and cost
Dead-Letter Queue (DLQ)Queue for messages that fail processing after N attempts
Message Retention1 minute to 14 days (default 4 days)
Message SizeUp to 256 KB (use S3 for larger payloads via Extended Client Library)
Delay QueueMessages become visible after a delay (0 seconds to 15 minutes)

SQS + Auto Scaling Pattern

A common exam pattern: SQS queue depth triggers Auto Scaling:

  1. Messages arrive in SQS queue
  2. CloudWatch monitors ApproximateNumberOfMessagesVisible
  3. Auto Scaling adds EC2/ECS consumers when queue depth grows
  4. Consumers process messages and queue shrinks
  5. Auto Scaling removes excess consumers

Amazon SNS (Simple Notification Service)

SNS is a fully managed pub/sub messaging service for application-to-application and application-to-person notifications.

SNS Subscriber Types

SubscriberUse Case
SQSFan-out to multiple queues
LambdaServerless processing
HTTP/HTTPSWebhook notifications
EmailHuman notifications
SMSText message alerts
Kinesis Data FirehoseStream to S3, Redshift, etc.
Mobile pushiOS, Android push notifications

SNS + SQS Fan-Out Pattern (Most Important)

This is the #1 most tested decoupling pattern on the SAA-C03:

  1. Producer publishes a message to an SNS topic
  2. SNS fans out the message to all subscribed SQS queues
  3. Each SQS queue has its own independent consumer
  4. Consumers process the message at their own pace

Benefits:

  • One message triggers multiple independent workflows
  • Each consumer can fail independently without affecting others
  • SQS queues buffer messages if consumers are slow
  • Adding new consumers is as simple as subscribing a new SQS queue

On the Exam: "The application needs to send one event to multiple downstream services for different processing" → SNS + SQS fan-out.

SNS FIFO Topics

SNS FIFO topics pair with SQS FIFO queues for ordered, deduplicated fan-out messaging.

Amazon EventBridge

EventBridge is a serverless event bus that routes events from various sources to targets based on rules.

EventBridge vs. SNS

FeatureEventBridgeSNS
Event sourcesAWS services, custom apps, SaaS partnersYour applications
RoutingContent-based filtering (event patterns)Topic-based (all subscribers get all messages)
Targets15+ (Lambda, SQS, Step Functions, API Gateway, etc.)SQS, Lambda, HTTP, email, SMS
SchemaSchema registry and discoveryNo schema support
ReplayArchive and replay past eventsNo replay
SaaS integrationYes (Zendesk, Datadog, Shopify, etc.)No

When to Use Which

ScenarioService
Simple queue between producer and consumerSQS
Fan-out one message to many consumersSNS + SQS
Route AWS service events to targetsEventBridge
SaaS integration (third-party events)EventBridge
Strict message ordering neededSQS FIFO
Archive and replay eventsEventBridge
Test Your Knowledge

An application needs to send a single order event to three different services: an inventory service, a shipping service, and a notification service. Each service must process the event independently. What architecture should be used?

A
B
C
D
Test Your Knowledge

A financial processing system requires messages to be processed in exactly the order they were sent, with no duplicate processing. Which SQS queue type should they use?

A
B
C
D
Test Your Knowledge

What is the purpose of an SQS Dead-Letter Queue (DLQ)?

A
B
C
D