← Back to Home
Cloud Integration
AWS CLF-C02 — SQS, SNS, Kinesis, EventBridge, Amazon MQ, and Communication Patterns
Synchronous vs Asynchronous Communication
Synchronous (Tightly Coupled)
- Application A directly calls Application B and waits for a response
- If Application B is overwhelmed, Application A might fail too
- Scaling is difficult — tightly coupled components
Asynchronous / Event-Based (Loosely Coupled)
- Application A sends a message to a queue/topic and moves on
- Application B processes messages at its own pace
- Components are decoupled — they can scale independently
- More resilient to failures and traffic spikes
Key Point:
AWS recommends decoupling applications using SQS (queue model), SNS (pub/sub model), or Kinesis (streaming model). This increases scalability and fault tolerance.
Amazon SQS (Simple Queue Service)
Fully managed message queue service for decoupling and scaling microservices, distributed systems, and serverless applications.
How It Works
- Producers send messages to the queue
- Consumers poll the queue, process messages, then delete them
- Multiple consumers can process messages in parallel
- Messages are kept in the queue until they are processed
Key Features
- Unlimited throughput — no limit on number of messages in the queue
- Default retention: 4 days, maximum: 14 days
- Low latency — less than 10ms on publish and receive
- Max message size: 256 KB
- Consumers delete messages after processing (important!)
- Can scale consumers with Auto Scaling Groups (ASG) based on queue depth
- Supports encryption (in-flight and at-rest)
SQS Standard vs FIFO
| Feature | SQS Standard | SQS FIFO |
| Throughput | Unlimited | 300 msg/s (without batching), 3000 msg/s (with batching) |
| Ordering | Best-effort ordering (may be out of order) | Guaranteed first-in-first-out ordering |
| Delivery | At-least-once (possible duplicates) | Exactly-once processing (no duplicates) |
| Queue Name | Any valid name | Must end in .fifo |
| Use Case | High throughput, order doesn't matter | Order matters (e.g., financial transactions) |
Exam Tip:
SQS = queue model (one consumer processes each message). Standard = high throughput, possible duplicates. FIFO = strict ordering, exactly-once. If the question says "decouple applications," think SQS.
Amazon SNS (Simple Notification Service)
Fully managed pub/sub (publish/subscribe) messaging service for sending notifications.
How It Works
- A publisher sends a message to an SNS Topic
- All subscribers to the topic receive the message (one-to-many)
- Up to 12,500,000 subscriptions per topic
- Up to 100,000 topics
Subscriber Types
- Email / Email-JSON
- SMS / Mobile push notifications
- HTTP / HTTPS endpoints
- SQS queues (common pattern!)
- Lambda functions
- Kinesis Data Firehose
SNS + SQS Fan-Out Pattern
A very common architecture pattern:
- Push a message to an SNS topic
- Multiple SQS queues subscribe to the topic
- Each queue receives a copy of every message
- Each queue can have its own consumer processing the message independently
- Use case: send the same event to multiple downstream services (e.g., order placed → inventory, shipping, analytics)
Key Point:
SQS = queue model (consumer pulls, one-to-one). SNS = pub/sub model (publisher pushes to many subscribers, one-to-many). Fan-out = SNS + SQS together for broadcasting to multiple queues.
Amazon Kinesis
Managed service for real-time streaming data at any scale. Collect, process, and analyze real-time data.
Kinesis Services
| Service | Purpose | Key Details |
| Kinesis Data Streams | Ingest and store streaming data | Real-time (~200ms). You manage consumers. Retention 1-365 days. Provisioned or on-demand capacity. |
| Kinesis Data Firehose | Load streaming data into destinations | Near real-time (60s buffer). Fully managed, serverless. Delivers to S3, Redshift, OpenSearch, HTTP endpoints. |
| Kinesis Data Analytics | Analyze streams with SQL or Apache Flink | Real-time analytics on streaming data. Fully managed. |
| Kinesis Video Streams | Capture and store video streams | For ML, analytics, playback. From cameras, security devices, etc. |
Exam Tip:
Kinesis = real-time data streaming. Data Streams = ingest (you manage). Data Firehose = deliver to destinations (fully managed). If the question says "real-time" or "streaming data," think Kinesis.
Amazon MQ
Managed message broker service for Apache ActiveMQ and RabbitMQ.
- For companies migrating from on-premises that already use traditional message brokers
- Supports industry-standard protocols: MQTT, AMQP, STOMP, OpenWire, WSS
- Does NOT scale as well as SQS/SNS (runs on servers, not serverless)
- Supports Multi-AZ with failover
- Supports both queue and topic features (SQS + SNS equivalent)
Exam Tip:
Amazon MQ = use when migrating from on-premises with existing protocols (MQTT, AMQP, etc.). For new cloud-native apps, always use SQS/SNS instead. MQ is NOT serverless.
Amazon EventBridge (formerly CloudWatch Events)
Serverless event bus service for building event-driven applications at scale.
Key Features
- React to events from AWS services, SaaS applications, and custom applications
- Create rules that match events and route them to target services
- Event Bus Types:
- Default Event Bus — receives events from AWS services
- Partner Event Bus — receives events from SaaS partners (Zendesk, Datadog, Shopify, etc.)
- Custom Event Bus — receives events from your own applications
Advanced Features
- Schema Registry — EventBridge can analyze events and infer the schema. Schema can be versioned.
- Archive & Replay Events — archive events (all or filtered) sent to an event bus, replay archived events later (great for debugging)
- Schedule expressions — create scheduled rules (cron jobs) like "run every hour"
Common Targets
- Lambda functions, SQS queues, SNS topics
- Step Functions, Kinesis Data Streams, EC2 actions
- ECS tasks, CodePipeline, API Gateway
Key Point:
EventBridge is the evolution of CloudWatch Events. It adds partner integrations, schema registry, and event archive/replay. It's the central event bus for event-driven architectures on AWS.
Integration Services Comparison
| Service | Model | Best For |
| SQS | Queue (pull) | Decoupling, buffering, one-to-one |
| SNS | Pub/Sub (push) | Notifications, one-to-many fan-out |
| Kinesis | Streaming | Real-time data processing, big data |
| EventBridge | Event Bus | Event-driven architecture, scheduled tasks, partner events |
| Amazon MQ | Message Broker | Migrating on-prem brokers (ActiveMQ/RabbitMQ) |