AWS Solutions Architect Handbook SAA-C03, from zero Bipin Singh
Integration, data & analytics

Decoupling with queues, topics and events

3 min readChapter 32 of 48By Bipin Singh

Loosely coupled systems keep working when one component slows down or fails, and each part can scale independently. Task statement 2.1 tests this directly, and "decouple" in a question almost always points to the services in this chapter.

Tight vs loose coupling

Amazon SQS (Simple Queue Service)

A fully managed message queue. Producers send messages; consumers poll, process, then delete them.

Standard queue FIFO queue
Throughput Nearly unlimited High, but limited per queue (higher with batching and high-throughput mode)
Ordering Best effort Strict order within a message group
Delivery At least once (occasional duplicates) Exactly-once processing (deduplication)
Use Most decoupling Order-sensitive workflows (financial transactions, sequential commands)

Key settings:

Setting Meaning
Visibility timeout How long a received message is hidden from other consumers while being processed (default 30 s, max 12 h). Set longer than processing time, or duplicates appear
Message retention 1 minute to 14 days (default 4 days)
Long polling Wait up to 20 s for messages — fewer empty responses, lower cost
Delay queues / message timers Postpone delivery up to 15 minutes
Dead-letter queue (DLQ) Messages that fail repeatedly (max receive count) move here for inspection
Message size Kept small; for large payloads, store the data in S3 and send a reference (the SQS Extended Client pattern)

Scaling consumers: Auto Scaling groups or ECS services scaled on queue depth / backlog per worker; Lambda can poll SQS directly with automatic scaling.

Amazon SNS (Simple Notification Service)

Publish/subscribe: a publisher sends a message to a topic; SNS pushes it to every subscriber — SQS queues, Lambda, HTTP/S endpoints, email, SMS, mobile push, Kinesis Data Firehose.

Fan-out pattern

               ┌──► SQS: inventory-queue ──► inventory service
Order placed ──► SNS topic ─┼──► SQS: shipping-queue ──► shipping service
               └──► SQS: analytics-queue ──► analytics

Each service gets its own durable queue and processes independently. A very common exam answer for "send the same event to several systems reliably".

Key idea

SQS = queue (one consumer group pulls; buffering, load levelling). SNS = topic (push to many subscribers). SNS + SQS = fan-out with durability.

Amazon EventBridge

A serverless event bus for event-driven architectures:

Cue: "react to events from many AWS services or SaaS apps with content-based routing" → EventBridge.

Amazon MQ

Managed Apache ActiveMQ and RabbitMQ brokers supporting standard protocols (AMQP, MQTT, STOMP, OpenWire, JMS).

Cue: "migrate an existing application that uses JMS/AMQP/MQTT messaging without rewriting code" → Amazon MQ. For new cloud-native apps, prefer SQS/SNS.

Amazon AppFlow

Fully managed, no-code data flows between SaaS applications (e.g. Salesforce, ServiceNow, Slack, Zendesk) and AWS services such as S3 and Redshift — with filtering and transformation. Cue: "regularly copy Salesforce data into S3 for analytics, no custom code".

Choosing

Need Service
Buffer work, absorb spikes, decouple producer from one consumer group SQS
Strict ordering and no duplicates SQS FIFO
Broadcast to many subscribers / notifications SNS
Same event to multiple services durably SNS → multiple SQS (fan-out)
Route events from AWS services/SaaS by content; schedules EventBridge
Existing JMS/AMQP/MQTT app Amazon MQ
Multi-step workflows with state, retries Step Functions
Real-time stream with replay and multiple readers Kinesis Data Streams (next chapter)
SaaS ↔ AWS data sync AppFlow

Exam patterns

Bipin Singh
Written by Bipin Singh

Senior Full-Stack Engineer · AI & AWS. I design and run production systems on AWS — serverless, data and AI.

Work with me