SAABlog
IntegrationIntermediate

SQS vs SNS vs EventBridge: How to Choose the Right Messaging Service

Compare AWS SQS, SNS, and EventBridge differences. Learn selection criteria for message queue, Pub/Sub, and event bus patterns for SAA-C03 exam.

PHILOLAMB-Updated: January 31, 2026
SQSSNSEventBridgeMessagingEvent-Driven

Related Exam Domains

  • Domain 2: Design Resilient Architectures

Key Takeaway

Use SQS for 1:1 message queuing (decoupling), SNS for 1:N Pub/Sub (fan-out), and EventBridge for event-based routing (rule-based filtering + SaaS integration). Combining them is common (e.g., SNS → SQS fan-out).

Exam Tip

Exam Essential: "Decoupling, async processing = SQS", "1:N broadcast = SNS", "Event-driven + SaaS integration = EventBridge", "SNS + SQS = fan-out pattern"

3 Messaging Patterns

1. Message Queue (SQS):
[Producer] → [Queue] → [Consumer]
→ 1:1, consumer pulls messages (Pull)

2. Pub/Sub (SNS):
[Publisher] → [Topic] → [Subscriber 1]
                      → [Subscriber 2]
                      → [Subscriber 3]
→ 1:N, topic pushes messages (Push)

3. Event Bus (EventBridge):
[Event Source] → [Event Bus] → Rule 1 → [Target A]
                             → Rule 2 → [Target B]
→ Rule-based routing, content filtering

Amazon SQS

Key Features

ItemDescription
PatternMessage Queue (Point-to-Point)
DeliveryPull (consumer retrieves messages)
Message RetentionUp to 14 days (default 4 days)
Message SizeUp to 256KB
OrderingStandard: ❌, FIFO: ✅
DeduplicationStandard: ❌, FIFO: ✅
ThroughputStandard: Unlimited, FIFO: 3,000/sec (batched)

Standard vs FIFO

Standard Queue:
[Message A, B, C] → Order NOT guaranteed ❌, At-least-once delivery
→ Unlimited throughput
→ Suitable for most use cases

FIFO Queue:
[Message A, B, C] → Order guaranteed ✅, Exactly-once delivery
→ 300/sec (3,000/sec with batching)
→ Order processing, financial transactions
→ Queue name must end with .fifo

DLQ (Dead-Letter Queue)

[SQS Main Queue]
      │
      ├── Processing Success → Message deleted
      │
      └── Processing Failure (maxReceiveCount exceeded)
              │
              ▼
         [DLQ] ← Failed messages isolated
              → Analyze/reprocess later

Exam Tip

SQS DLQ: Isolates messages that repeatedly fail processing. The maxReceiveCount setting determines how many failures before sending to DLQ.

Visibility Timeout

Consumer A retrieves message
→ Message invisible to other consumers (default 30 seconds)
→ Complete processing + delete within 30 seconds → Success
→ Exceeds 30 seconds → Becomes visible again → Another consumer can process

Amazon SNS

Key Features

ItemDescription
PatternPub/Sub (Publish/Subscribe)
DeliveryPush (pushes to subscribers)
Subscriber CountUp to 12,500,000 per topic
Message SizeUp to 256KB
Message Retention❌ (lost on delivery failure)
FilteringSubscription filter policies

Subscription Protocols

ProtocolDescription
SQSDeliver to SQS queue
LambdaInvoke Lambda function
HTTP/SPOST to HTTP endpoint
EmailSend email
SMSSend text message
Kinesis Data FirehoseDeliver to stream

SNS + SQS Fan-out Pattern

Order Completed Event:

[Order Service] → [SNS Topic: OrderComplete]
                      │
                      ├── [SQS: Payment Queue] → [Payment Service]
                      ├── [SQS: Inventory Queue] → [Inventory Service]
                      ├── [SQS: Notification Queue] → [Notification Service]
                      └── [Lambda: Analytics Recording]

→ Each service processes independently
→ One failure doesn't affect other services

Exam Tip

SNS + SQS Fan-out: When exam scenarios mention "one event needs to be processed independently by multiple services," this pattern is the answer.

Message Filtering

SNS Topic: Order Events

Subscription 1 (Payment Service):
Filter: {"order_type": ["premium"]}
→ Receives only premium orders

Subscription 2 (General Processing):
Filter: None
→ Receives all orders

Amazon EventBridge

Key Features

ItemDescription
PatternEvent Bus
Event SourcesAWS services, SaaS, custom apps
Targets18+ AWS services
FilteringEvent patterns (content-based)
SchemaSchema registry + code generation
Archiving✅ Event archiving and replay

Event Rules

EventBridge Rule Examples:

Rule 1: EC2 State Change
Event Pattern: {"source": ["aws.ec2"], "detail-type": ["EC2 Instance State-change"]}
Target: SNS → Admin notification

Rule 2: S3 Object Created
Event Pattern: {"source": ["aws.s3"], "detail": {"bucket": {"name": ["my-bucket"]}}}
Target: Lambda → File processing

Rule 3: Schedule
Schedule: cron(0 9 * * ? *)
Target: Lambda → Daily 9 AM report generation

EventBridge Differentiators

Features EventBridge has that SNS doesn't:

1. SaaS Integration (Zendesk, Shopify, Datadog, etc.)
2. Schema Registry (auto-discover event structure)
3. Event Archiving & Replay
4. Schedule-based triggers (cron)
5. API Destinations (external API calls)
6. Global Endpoints (cross-region)

3 Services Comparison

ItemSQSSNSEventBridge
PatternQueue (1:1)Pub/Sub (1:N)Event Bus
DeliveryPullPushPush
Message RetentionUp to 14 daysArchiving available
FilteringSubscription filtersEvent patterns (powerful)
OrderingFIFO onlyFIFO topics
SaaS Integration
Scheduling✅ (cron/rate)
Target Count112.5M subscribers5 targets/rule
CostPer requestPublish + delivery$1/million events

Selection Guide

Messaging Service Selection:
        │
        ▼
1:1 Async Processing + Decoupling?
        │
       Yes → [SQS]
        │     ├── Need ordering? → FIFO
        │     └── No ordering needed? → Standard
        No
        │
        ▼
1:N Message Broadcast?
        │
       Yes → [SNS]
        │     └── Fan-out to multiple SQS? → SNS + SQS
        No
        │
        ▼
Event-driven Architecture / SaaS Integration / Scheduling?
        │
       Yes → [EventBridge]
        │
        No
        │
        ▼
Real-time Streaming Data?
        │
       Yes → [Kinesis]

Combination Patterns

SNS + SQS (Most Common)

[Producer] → [SNS] → [SQS 1] → [Consumer 1]
                   → [SQS 2] → [Consumer 2]
→ Fan-out + independent processing + message retention

EventBridge + SQS

[AWS Service Events] → [EventBridge] → Rule → [SQS] → [Lambda]
→ Event filtering + reliable processing

SAA-C03 Exam Focus Points

  1. Decoupling: "Component separation + async = SQS"
  2. Fan-out: "1:N broadcast = SNS, SNS + SQS combination"
  3. FIFO: "Order guarantee + deduplication = SQS FIFO"
  4. DLQ: "Isolate failed messages = Dead-Letter Queue"
  5. EventBridge: "SaaS integration, scheduling, event-driven = EventBridge"

Exam Tip

Sample Exam Question: "In an order system, when an order is completed, payment, inventory, and notification services must each process independently. One service failure should not affect other services." → Answer: SNS topic + SQS queue per service (fan-out pattern)

Frequently Asked Questions

Q: Should I use SQS and SNS together?

For fan-out scenarios, combine SNS + SQS. When SNS delivers messages to multiple SQS queues, each consumer processes independently, and failed messages stay in the queue for retry.

Q: Can EventBridge replace SNS?

In many cases yes, but SNS has unique features like SMS/email delivery and massive subscriber support. Use EventBridge for AWS service event-based routing, SNS for A2P notifications.

Q: Can SQS messages be delivered more than once?

Standard Queue uses at-least-once delivery, so duplicates are possible. Use FIFO Queue for exactly-once delivery, or implement idempotency in consumers.

Q: How should I set SQS visibility timeout?

Set it longer than the message processing time. If too short, messages being processed become visible to other consumers. Default is 30 seconds, maximum is 12 hours.

Q: What should I consider when integrating Lambda with SQS?

Lambda uses SQS as an event source to automatically poll messages. Configure batch size, concurrency, and error handling (DLQ settings) appropriately. FIFO queues process only one Lambda per message group ID.



References