Lesson 11

App Integration Services

SNS, SQS, and Step Functions — decoupling and orchestrating applications

Amazon Simple Notification Service (SNS)

Amazon SNS is a fully managed pub/sub messaging service. It enables you to send messages to a large number of subscribers through a "topic" — a communication channel.

How It Works

  • A publisher sends a message to an SNS topic.
  • All subscribers to that topic receive the message.
  • Subscribers can be email, SMS, mobile push, HTTP/HTTPS endpoints, Amazon SQS queues, AWS Lambda functions, and more.

Common Patterns

PatternDescription
Fan-outOne message published to an SNS topic is delivered to multiple SQS queues, each processed independently.
CloudWatch Alarm to SNSCloudWatch alarms send notifications to an SNS topic, which delivers them via email, SMS, or triggers automated actions.
Lambda Event SourceSNS topics can invoke Lambda functions asynchronously. When a message is published, Lambda runs with the message as input.

Amazon Simple Queue Service (SQS)

Amazon SQS is a fully managed message queuing service. It enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead of managing and operating message-oriented middleware.

Queue Types

TypeCharacteristics
Standard QueueNearly unlimited throughput. Best-effort ordering. At-least-once delivery. Messages may arrive in a different order than sent.
FIFO QueueFirst-In-First-Out delivery. Exactly-once processing. Messages are processed in the exact order they are sent. Limited to 300 messages per second (or 3,000 with high-throughput mode).

Key Concepts

  • Producer: Sends messages to the queue.
  • Consumer: Polls the queue for messages and processes them.
  • Visibility timeout: After a consumer receives a message, it becomes invisible to other consumers for a configurable period. If not deleted before timeout expires, the message reappears in the queue.
  • Dead-letter queue (DLQ): A queue that receives messages that failed processing after a specified number of attempts. Enables investigation of problematic messages.

SNS + SQS Fan-Out

A common pattern: SNS publishes to a topic, and multiple SQS queues subscribe. Each queue can be consumed independently by different services — enabling parallel processing without coupling producers to consumers.

AWS Step Functions

AWS Step Functions is a serverless workflow orchestration service. It lets you coordinate multiple AWS services into flexible, visual workflows. You define state machines using a JSON-based Amazon States Language (ASL).

Key Capabilities

  • Sequential steps: Chain Lambda functions or service integrations one after another.
  • Parallel execution: Run multiple branches concurrently.
  • Branching: Use choice states for conditional logic.
  • Error handling: Built-in retry with backoff, catch blocks, and fallback states.
  • Human approval: Pause workflows for manual review or sign-off.

Common Use Cases

Use CaseServices Involved
Order processing pipelineAPI Gateway → Step Functions → Lambda → SQS → DynamoDB
ETL workflowStep Functions → Lambda → Glue → Redshift
Microservice orchestrationStep Functions coordinating multiple Lambda functions with error handling

SNS vs. SQS vs. Step Functions

ServicePatternMessage ModelKey Differentiator
SNSPub/sub (push)Push to all subscribersOne message to many receivers simultaneously
SQSMessage queue (poll)Pull by consumersDecoupling producer and consumer with durable buffer
Step FunctionsWorkflow orchestrationState machine executionCoordinate multi-step processes with retry and branching

App Integration Quiz

Select one answer per question. You will receive immediate feedback.

1. An application needs to broadcast a message to many subscribers simultaneously, including email recipients and Lambda functions. Which service should be used?
2. A company has a producer that generates orders and a consumer that processes them. The consumer processes messages at a variable rate, and messages must not be lost. Which service provides a durable buffer between them?
3. A developer needs to coordinate multiple Lambda functions into a long-running workflow with retry logic and conditional branching. Which service should they use?
4. A company wants to deliver one incoming message to three separate SQS queues so that three different services each process the same message independently. What pattern should they use?
Progress: 0/4 correct (0%). Answer all questions to see the final recommendation.
Primary Source: AWS Academy Module 6: Compute (module-6.txt) — Lambda event sources including SNS and SQS, Step Functions orchestration. Module 10: Auto Scaling and Monitoring (module-10.txt) — SNS and SQS with CloudWatch. Module 2: Cloud Economics and Billing (module-2.txt) — SNS email notifications.
Last updated: June, 2026© 2026 Shahriar Ahmed ShovonCredits