All writing2026.09.22 · SAA-C03 · AWS Solutions Architect Associate · 1 min

AWS Messaging and Serverless: Design Delivery Semantics First

Separate queues, pub/sub, streams and orchestration before connecting Lambda, API Gateway and event-driven workloads.

Before choosing a messaging service, answer: one consumer or many, work queue or replayable history, required ordering, tolerated duplicates, throughput, and retention.

Need Start with
Buffer work for competing consumers SQS
Push one event to many subscribers SNS
Ordered replayable event stream Kinesis Data Streams
Deliver buffered streams to destinations Data Firehose
Route application/SaaS/AWS events by rules EventBridge
Existing ActiveMQ/RabbitMQ protocol Amazon MQ

SQS Standard is highly scalable with at-least-once delivery and best-effort ordering. Make consumers idempotent. FIFO adds ordering within message groups and deduplication semantics at lower throughput constraints. Visibility timeout must exceed processing or be extended; repeated failures belong in a DLQ with a deliberate redrive policy.

SNS fan-out commonly publishes to separate SQS queues so each consumer gets independent buffering and retries. EventBridge is better when routing rules, SaaS integration, schemas, or event buses are central.

Serverless still has state and failure

Lambda synchronous, asynchronous, and poll-based invocations retry differently. Reserved concurrency protects capacity; provisioned concurrency reduces cold-start latency. Putting Lambda in a VPC is for access to VPC resources, not general performance. Use RDS Proxy to avoid connection storms.

API Gateway provides managed HTTP/WebSocket entry, authentication, throttling, and endpoint types. Step Functions owns workflow state, retries, branching, and compensation; SQS owns durable work buffering. Cognito User Pools authenticate users; Identity Pools exchange identities for AWS credentials.

Exam lens: “exactly once” is not created by choosing FIFO alone. The producer, broker, consumer, state change, and retry path must agree.

Review card

  • Queue distributes work; topic fans out; stream retains ordered records.
  • SQS consumers must handle duplicates.
  • DLQ is diagnosis and isolation, not automatic recovery.
  • EventBridge routes events; Step Functions coordinates workflow state.
  • Design retries and idempotency before adding Lambda.

選 messaging service 前先回答:一個或多個 consumer、work queue 或 replayable history、是否需 ordering、能否接受 duplicate、throughput 與 retention。

需求 優先想
給 competing consumers 的工作緩衝 SQS
一個 event push 給多 subscriber SNS
Ordered、replayable event stream Kinesis Data Streams
把 buffered stream 送到 destination Data Firehose
依 rule 路由 application/SaaS/AWS event EventBridge
現有 ActiveMQ/RabbitMQ protocol Amazon MQ

SQS Standard 高 scalability、at-least-once、best-effort ordering,consumer 必須 idempotent。FIFO 在 message group 內保序並有 deduplication semantics,但有不同 throughput 限制。Visibility timeout 要大於 processing time 或動態延長;反覆失敗送 DLQ,並要有明確 redrive policy。

SNS fan-out 常送到多個獨立 SQS queue,讓每個 consumer 有自己的 buffering/retry。需 routing rule、SaaS integration、schema 或 event bus 時用 EventBridge。

Serverless 仍然有 state 與 failure

Lambda synchronous、asynchronous、poll-based invocation 的 retry 不同。Reserved concurrency 保留/限制 capacity;provisioned concurrency 降 cold start。Lambda 進 VPC 是為存取 VPC resource,不是通用 performance 優化。連 RDS 用 RDS Proxy 避免 connection storm。

API Gateway 提供 HTTP/WebSocket entry、auth、throttling 與 endpoint types。Step Functions 管 workflow state/retry/branch/compensation;SQS 管 durable work buffering。Cognito User Pool 驗證 user;Identity Pool 換 AWS credentials。

考試視角: 選 FIFO 不會單獨產生 exactly-once。Producer、broker、consumer、state change 與 retry path 都要對齊。

複習卡

  • Queue 分工;topic fan-out;stream 保留 ordered records。
  • SQS consumer 要能處理 duplicate。
  • DLQ 用於隔離與診斷,不會自動修復。
  • EventBridge route event;Step Functions 協調 workflow state。
  • 加 Lambda 前先定義 retry/idempotency。