14 - Decoupling Applications SQS SNS Kinesis MQ

Decoupling Applications (SQS, SNS, Kinesis, MQ) - Section Overview

awssqssnskinesisamazon-mqdecouplingsaa-c03

Section Map

This section covers AWS integration and messaging: the middleware used to orchestrate communication between your services. It builds on the Auto Scaling group notes in ASG (SQS queue length drives ASG scaling).

# Topic Key Concepts
01 Introduction to Messaging Synchronous vs asynchronous (event based) communication, sudden spikes, decoupling layer: SQS (queue), SNS (pub/sub), Kinesis (real-time streaming)
02 SQS - Standard Queues Producers and consumers, unlimited throughput, 4 days default / 14 days max retention, 1 MiB messages (256 KB in the course), at least once delivery, SendMessage, DeleteMessage, security, hands-on
03 SQS - Message Visibility Timeout 30 seconds default, ChangeMessageVisibility, 0 seconds to 12 hours
04 SQS - Long Polling 1 to 20 seconds, fewer API calls, lower latency, WaitTimeSeconds
05 SQS - FIFO Queues Ordering, 300 / 3,000 messages per second by default, deduplication ID (5 minutes), message group ID, .fifo name
06 SQS + Auto Scaling Group ApproximateNumberOfMessages alarm, SQS as a database write buffer, tier decoupling
07 Amazon SNS Pub/sub, topics and subscribers, standard vs FIFO topics, access policy, hands-on
08 SNS + SQS Fan-Out Pattern One publish to many SQS queues, S3 events to multiple queues, SNS to Firehose to S3, FIFO fan-out
09 Amazon Kinesis Data Streams Real-time streaming, shards, retention up to 365 days, replay, provisioned vs on-demand, hands-on
10 Amazon Data Firehose Near real-time, buffer, S3 / Redshift / OpenSearch, Lambda transform, hands-on
11 SQS vs SNS vs Kinesis Pull vs push vs stream, persistence, ordering, replay, consumption modes
12 Amazon MQ Managed RabbitMQ / ActiveMQ, open protocols (MQTT, AMQP, STOMP, Openwire, WSS), multi-AZ failover (ActiveMQ: EFS or EBS; RabbitMQ: EBS)

Key Exam Topics

  • Application decoupling - anytime you see it on the exam, think Amazon SQS
  • Synchronous (direct connection) vs asynchronous (queue in between); sudden spikes or unpredictable load -> decouple with SQS, SNS or Kinesis
  • SQS Standard - unlimited throughput, unlimited messages, 4 days default retention (14 days max), messages up to 1 MiB (256 KB in the course), at least once delivery, best-effort ordering
  • Visibility timeout - 30 seconds default, extend with ChangeMessageVisibility
  • Long polling - 1 to 20 seconds via WaitTimeSeconds, preferred over short polling
  • SQS FIFO - ordering, 300 msg/s (3,000 with batching) by default; high-throughput mode goes higher, deduplication within 5 minutes, ordering per message group ID, name ends in .fifo
  • SQS + ASG - scale on the ApproximateNumberOfMessages CloudWatch metric
  • SQS as a buffer in front of a database to avoid losing transactions during a spike
  • SNS - pub/sub, every subscriber gets each message (unless filtered)
  • SNS + SQS fan-out - one publish, many SQS queues, fully decoupled, no data loss
  • Kinesis Data Streams - real time keyword, shards, retention up to 365 days, replay
  • Amazon Data Firehose - near real-time keyword, loads data into S3, Redshift, OpenSearch and others
  • SQS vs SNS vs Kinesis - pull and delete vs push to subscribers vs persisted replayable stream
  • Amazon MQ - migrate on-premises apps that use open protocols (MQTT, AMQP, etc.) without re-engineering for SQS/SNS; less scalable than SQS/SNS; multi-AZ failover backed by EFS for ActiveMQ (RabbitMQ uses EBS)
AWS update (2025-08)

SQS maximum message size is now 1 MiB for Standard and FIFO (changed 2025-08); the course said 256 KB. FIFO 300 / 3,000 per second are the defaults without high-throughput mode, which reaches up to 70,000 TPS non-batched in us-east-1, us-west-2 and eu-west-1 and less in other Regions. The exam may still use the course figures. AWS source FIFO quotas

Check yourself

Quiz