ladderlore
  • 输入服务名称,例如 S3 或 IAM。

概念

Event-driven and loose coupling patterns

Parts that talk through queues, topics and events, so a slow or failed part does not stop the others.

本课尚未翻译,暂以英文显示。

  • One consumer takes each message, burst buffer

    Choose
    SQS
    Why
    Pull queue, message deleted after use
  • One message to many subscribers

    Choose
    SNS
    Why
    Push to queues, functions, email, SMS
  • Route events by content, SaaS and AWS events

    Why
    Rules, many targets, schedules
  • Ordered stream, replay, many readers

    Choose
    Kinesis
    Why
    Ordered shards, data kept up to 365 days
Match the clue in the question to the messaging service.

1 / 2

  • One consumer takes each message, burst buffer

    Choose
    SQS
    Why
    Pull queue, message deleted after use
  • One message to many subscribers

    Choose
    SNS
    Why
    Push to queues, functions, email, SMS

2 / 2

  • Route events by content, SaaS and AWS events

    Why
    Rules, many targets, schedules
  • Ordered stream, replay, many readers

    Choose
    Kinesis
    Why
    Ordered shards, data kept up to 365 days
Match the clue in the question to the messaging service.
Order service
SNS
Billing queue
Stock queue
Email queue
Fan-out: one publish, three queues. Each team processes at its own pace.

是什么

In a tightly coupled design, one service calls another and waits. If the second is slow or down, the first fails too. In a loosely coupled design, a service hands off a message or an event and moves on. The receiver works at its own pace and can fail and recover without the sender noticing. This is asynchronous messaging.

是什么

Four patterns appear again and again. A queue as a buffer (load levelling) lets producers send bursts that consumers drain steadily. Fan-out sends one message to many consumers: Amazon SNS to several Amazon SQS queues. Event routing sends each event to the right target by its content: Amazon EventBridge. Streaming keeps an ordered log that many readers can replay: Amazon Kinesis Data Streams.

Messages can arrive twice, so consumers must be idempotent: handling the same message twice has the same result as handling it once. Messages that keep failing go to a dead-letter queue (DLQ), so they do not block the rest.

要记住

  • Synchronous: the caller waits. Asynchronous: the caller hands off and moves on.
  • Queue as buffer: it absorbs spikes, and consumers scale on queue depth.
  • Fan-out: an SNS topic with one SQS queue per consumer.
  • Idempotent consumers: a repeated message must do no harm.
  • DLQ: parks messages that fail again and again, for later review.

要记住

  • Order and replay point to FIFO queues or Kinesis. Routing by content points to EventBridge.

考试中

  • “The web tier must not lose orders when the processing tier is slow” points to an SQS queue between them.
  • “One event must start three independent processes” points to SNS fan-out to SQS, or an EventBridge rule with three targets.
  • “React to events from AWS services or SaaS apps with rules” points to EventBridge.
  • “Many consumers read the same ordered records and can replay them” points to Kinesis Data Streams.