Event-driven patterns with EventBridge
Deploying Applications on AWS
Dunieski Otano
Amazon Web Services Solutions Architect
One order, four reactions
One order must reach billing, fulfillment, analytics, email
Direct calls to all four are brittle and slow
One event fans out to every consumer
Choosing the right messaging services
SQS
: one queue, one consumer group, at-least-once
SNS
: pub/sub, push one message to many subscribers
EventBridge
: route events by content to many targets
Kinesis Data Streams
: ordered, replayable streaming
The fanout pattern
One event must reach
several consumers
at once
Publish to an
SNS topic
Each
SQS queue
subscribes to the topic
Every consumer gets its own copy, decoupled
Filtering so consumers get only what they need
Without filters, every subscriber gets
every event
SNS subscription filter policies
: filter by message attributes
EventBridge content filters
: match on event fields
Each consumer receives only its relevant events
Routing with EventBridge
Event bus
: receives events from many sources
Rule
: an event pattern that matches certain events
Target
: where matched events are sent
One event can route to multiple targets
Streaming with Kinesis Data Streams
A
continuous, real-time
flow of records
Ordered
records within a shard
Replayable
: consumers re-read from any point
Multiple consumers read the
same
stream independently
Use for clickstream, telemetry, high-throughput data
Lambda as an event consumer
Lambda can be triggered by
SQS, SNS, EventBridge, Kinesis
Event source mapping
polls SQS and Kinesis for you
SNS and EventBridge
push
events to Lambda
Near-real-time processing with no servers to manage
Let's practice!
Deploying Applications on AWS
Preparing Video For Download...