Uni Cert / SAA-C03 / Loose coupling with SQS, SNS, and EventBridge

Loose coupling with SQS, SNS, and EventBridge

Async patterns, retries, DLQs, and event-driven resilience.

Estimated reading: ~28 min

Why decouple?

Tightly coupled systems fail together: a spike or crash in one service cascades to others. Loose coupling absorbs spikes, isolates failures, and lets teams deploy independently — core SAA resilient design theme.

Messaging patterns

PatternServiceModel
QueueSQSPull; one consumer per message (standard) or FIFO ordering
Pub/sub fan-outSNSPush to many subscribers (Lambda, SQS, HTTP, email)
Event busEventBridgeSchema-based routing from AWS services and custom apps
StreamKinesisReal-time ordered records; multiple consumers read same stream

Amazon SQS essentials

  • Standard queue — at-least-once delivery, best-effort ordering, nearly unlimited throughput.
  • FIFO queue — exactly-once processing, strict order, throughput limits (batching + high throughput mode on exam as option).
  • Visibility timeout — message hidden while worker processes; extend if job takes longer or message returns to queue.
  • Dead-letter queue (DLQ) — after maxReceiveCount failures, message moves to DLQ for inspection (poison pill pattern).
  • Long polling — reduces empty receives and cost (WaitTimeSeconds).

Exam pattern: sudden traffic burst → queue between API and workers → Auto Scaling on worker fleet based on queue depth (CloudWatch ApproximateNumberOfMessagesVisible).

Amazon SNS

  • Topics publish to multiple subscribers in parallel.
  • Common combo: SNS → SQS fan-out (each subscriber queue gets a copy) for durable parallel processing.
  • Message filtering — subscribers receive subset based on JSON attributes.
  • FIFO topics exist for strict ordering use cases.

Amazon EventBridge

  • Event bus — default bus for AWS service events; custom buses for multi-account/org patterns.
  • Rules match event patterns → target (Lambda, Step Functions, SQS, SNS, API destinations).
  • Schema registry — discover and enforce event shapes.
  • Archive & replay — debug and reprocess events.

Prefer EventBridge over SNS when routing many event types from AWS services with content-based filtering.

Idempotency and ordering

  • Design consumers idempotent — duplicate deliveries happen (SQS standard, SNS retries).
  • Need strict order per customer? FIFO SQS or Kinesis partition key — not standard SQS.

Step Functions (bonus tie-in)

Orchestrate multi-step workflows with built-in retries, catch, and parallel branches — exam mentions when coordinating Lambda + human approval + compensating transactions.

Reference architecture

API Gateway → Lambda → SQS → EC2/ECS workers (Auto Scaling on queue depth)
                      ↘ DLQ → alarm → ops
S3 upload event → EventBridge rule → Lambda thumbnail + SNS notify

Exam traps

  • SQS is pull — consumers poll; SNS is push.
  • DLQ must be same type (FIFO → FIFO) and configured on source queue.
  • "Exactly-once" in exam usually means FIFO SQS + idempotent consumer, not standard queue.

Official reference

SAA-C03 exam guide — scalable and loosely coupled architectures.

Official reference: AWS documentation

Chat with G.U.S.

Share suggestions to improve the site or any complaints. We use your feedback to make unigrat.com better.

Hi, I am G.U.S. — Growth Upgrade Suggestions.

Share your suggestions or complaints below.