Application Integration
Why applications talk through queues, topics and streams instead of calling each other directly, and the map of this group.
What it is
As soon as more than one application runs, they need to talk to each other. A web shop's buying service has to tell the shipping service about each new order. There are two ways to do it.
- Synchronous (application to application): the buying service calls the shipping service and waits. Simple, but if shipping is slow or down, buying is too. Sudden spikes are a problem: what if 1,000 videos suddenly need encoding when the usual load is 10?
- Asynchronous or event-based (application to queue to application): the buying service drops a message in a queue and carries on; the shipping service picks it up when it can.
The second way decouples the applications: each one can scale, fail and be updated on its own. AWS offers three models for it:
- SQS, the queue model;
- SNS, the pub/sub (publish/subscribe) model;
- Kinesis, the real-time streaming model.
These services scale independently from the application. The group also covers Amazon MQ (for apps using standard broker protocols), EventBridge (event routing), Step Functions (workflows), AppFlow (SaaS data transfer) and the email and messaging services SES and Pinpoint.
Example
A video site lets users upload videos. The web tier saves each upload to S3 and puts a message in an SQS queue. A fleet of EC2 workers encodes videos from the queue, scaling with its length. When a video is ready, an SNS topic tells the user by email and updates the search index. During a viral spike, uploads keep working: the queue just grows for a while.
In this group
Queues: SQS
Amazon SQS
Standard queues, producers and consumers, visibility timeout, long polling.
SQS FIFO and patterns
FIFO queues, dead-letter queues, SQS as a buffer.
Notifications: SNS
Amazon SNS
Topics, subscribers, publishing and security.
SNS fan-out and filtering
SNS + SQS fan-out, FIFO topics, message filtering.
Streaming
Kinesis and Data Firehose
Kinesis Data Streams, capacity modes, Amazon Data Firehose.
SQS vs SNS vs Kinesis
Which one to pick, side by side.
More integration
Amazon MQ
Managed ActiveMQ and RabbitMQ for existing apps.
Amazon EventBridge
Event buses, rules, schedules, archive and replay.
AWS Step Functions
Visual workflows that orchestrate services.
Amazon AppFlow
Move data between SaaS apps and AWS.
Amazon SES and Pinpoint
Sending email and marketing messages.
Exam tips
- "Decouple", "absorb spikes", "the backend can't keep up" → SQS between the tiers.
- "Send one message to many receivers" → SNS (often SNS + SQS fan-out).
- "Real-time streaming", "clickstream", "IoT data", "replay" → Kinesis Data Streams.
- "Load streaming data into S3 or Redshift with no code" → Amazon Data Firehose.
- "Migrate an app that uses MQTT, AMQP or JMS without rewriting it" → Amazon MQ.
- "React to an event in an AWS service", "cron job" → EventBridge.
- "Orchestrate several Lambda functions with retries and human approval" → Step Functions.
Common traps
- "Call the other service's API directly for reliability." Direct calls couple the services; a queue keeps work safe when one side is down.
- "SNS keeps messages until a subscriber reads them." SNS doesn't store messages; put an SQS queue behind it.
AWS documentation
Edge functions
Running code at CloudFront edge locations with CloudFront Functions and Lambda@Edge, their triggers, limits and use cases, and how to choose.
Amazon SQS
SQS standard queues, how producers send and consumers receive and delete messages, scaling consumers with Auto Scaling, security, visibility timeout and long polling.