Skip to main content
AWS Messaging and Integration Services

Module Overview

Estimated Time: 4-5 hours | Difficulty: Intermediate-Advanced | Prerequisites: Compute, Networking
Event-driven architectures enable loose coupling, scalability, and resilience. Think of these services as the postal system of your cloud infrastructure — SQS is like a mailbox (one recipient picks up the letter), SNS is like a newspaper subscription (one publisher, many readers), and EventBridge is like a smart mail sorting center that reads the content and routes it to the right destination automatically. This module covers AWS messaging and integration services for building modern distributed systems. What You’ll Learn:
  • SQS queues and message processing patterns
  • SNS pub/sub and fan-out architectures
  • EventBridge for event-driven applications
  • Step Functions for workflow orchestration
  • API Gateway advanced patterns
  • Choosing the right integration pattern

Integration Patterns Overview


SQS Deep Dive

Queue Types

SQS Implementation


SNS Deep Dive

Fan-Out Pattern

SNS Implementation


EventBridge Deep Dive

Event-Driven Architecture

EventBridge Implementation


Step Functions

Workflow Orchestration

Step Functions ASL Definition


API Gateway Integration

Direct Service Integrations

API Gateway to SQS Direct Integration


🎯 Interview Questions

SQS:
  • Point-to-point messaging
  • Decoupling with buffering
  • One consumer per message
  • Need message persistence
SNS:
  • Fan-out to multiple subscribers
  • Push-based delivery
  • Simple attribute filtering
  • Mobile push, email, SMS
EventBridge:
  • Event-driven architectures
  • Content-based filtering (JSON path)
  • AWS service integration
  • Schema registry
  • Event archive/replay
Combined pattern: Event → EventBridge → SNS → Multiple SQS queuesCommon mistake: Using EventBridge when you only need simple fan-out (SNS is cheaper and lower-latency), or using SNS when you need content-based filtering on nested JSON fields (EventBridge handles this natively). A senior engineer picks the simplest tool that meets the requirements — not the most feature-rich one.
Dead Letter Queue (DLQ) pattern:
  1. Configure maxReceiveCount on source queue
  2. After N failed processing attempts, message moves to DLQ
  3. Set up CloudWatch alarm on DLQ depth
  4. Process DLQ separately:
    • Manual review
    • Automated retry with fixes
    • Archive for analysis
Best practices:
  • DLQ retention longer than source (14 days)
  • Same queue type (Standard/FIFO)
  • Monitor ApproximateNumberOfMessagesVisible
Visibility timeout:
  • Time a message is hidden after being received
  • Prevents other consumers from processing same message
  • If not deleted in time, message reappears
Setting it correctly:
  • Should be longer than processing time
  • Too short = duplicate processing
  • Too long = delayed retry on failure
Dynamic extension:
For FIFO queues:
  • Built-in deduplication (5-minute window)
  • Message deduplication ID
  • Content-based deduplication
For Standard queues (at-least-once):
  • Idempotent consumers
  • Store processed message IDs in DynamoDB
  • Use conditional writes
Saga for distributed transactions:
Step Functions features:
  • Catch blocks for compensation
  • Parallel branches for concurrent steps
  • Wait states for human approval
  • Express workflows for high-volume
Key pattern: Each step has a compensating transaction

🧪 Hands-On Lab: Event-Driven Order System

1

Create SNS Topic

Topic for order events with filter policies
2

Create SQS Queues

Inventory queue, shipping queue with DLQs
3

Set Up Fan-Out

Subscribe queues to SNS with filters
4

Create EventBridge Rule

High-value order detection with Lambda target
5

Build Step Functions Workflow

Order processing with parallel steps and error handling
6

Test End-to-End

Publish events, verify all systems receive appropriate messages

Next Module

DevOps & CI/CD

Master CodePipeline, CloudFormation, CDK, and infrastructure automation