概念
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
- Choose
EventBridge
- Why
- Rules, many targets, schedules
Ordered stream, replay, many readers
- Choose
Kinesis
- Why
- Ordered shards, data kept up to 365 days
| Need | Choose | Why |
|---|---|---|
| One consumer takes each message, burst buffer | Pull queue, message deleted after use | |
| One message to many subscribers | Push to queues, functions, email, SMS | |
| Route events by content, SaaS and AWS events | Rules, many targets, schedules | |
| Ordered stream, replay, many readers | Ordered shards, data kept up to 365 days |
1 / 2
2 / 2
Route events by content, SaaS and AWS events
- Choose
EventBridge
- Why
- Rules, many targets, schedules
Ordered stream, replay, many readers
- Choose
Kinesis
- Why
- Ordered shards, data kept up to 365 days
| Need | Choose | Why |
|---|---|---|
| Route events by content, SaaS and AWS events | Rules, many targets, schedules | |
| Ordered stream, replay, many readers | Ordered shards, data kept up to 365 days |
概要
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.
混同しやすいもの
Amazon Simple Queue Service (Amazon SQS)The settings that decide behavior: visibility timeout, long polling, delay, retention, DLQs, and scaling on queue depth.
Amazon Simple Notification Service (Amazon SNS)Filter policies, FIFO topics, fan-out to SQS, retries and DLQs, and when to pick SNS, SQS or EventBridge.
Amazon EventBridgeEvent buses, rules, Pipes, Scheduler, archive and replay, and events across accounts and Regions.
ほかのタスクにも登場
このタスクの内容 · 2.1
- Microservices and stateless design
- Multi-tier architectures
- Event-driven and loose coupling patterns
- Serverless application patterns
- AWS Amplify and AWS Device Farm
- Horizontal vs vertical scaling
- Caching strategies
Load Balancing
API Gateway
- When and how to containerize
SQS
SNS
EventBridge
Step Functions
MQ
Secrets Manager
- Choosing purpose-built services
- Choosing object, file or block
Lambda
- Read replicas
ElastiCache
CloudFront
Global Accelerator
Transfer Family
S3
EFS
EBS
Fargate
ECS
EKS