Event-driven patterns with EventBridge
1. Event-driven patterns with EventBridge
Welcome back. We've shaped the application and put an API in front of it. Now we connect the pieces with events. In this video, you'll learn how to choose between SQS, SNS, EventBridge, and Kinesis Data Streams, build a fanout with SNS and SQS, filter events so each consumer gets only what it needs, route events with EventBridge rules, and trigger Lambda, AWS's way of running code without managing servers, from all of them. Let's get started.2. One order, four reactions
A customer places an order. Billing must charge the card, fulfillment must ship it, analytics must record it, and email must confirm it. Wiring the order service to call all four directly is brittle and slow. Events let one message fan out to every consumer at once.3. Choosing the right messaging services
These four services each do a different job, and real systems usually combine several rather than picking just one. Amazon SQS is a queue: one consumer group pulls messages, with at-least-once delivery, ideal for decoupling work. Amazon SNS is publish-subscribe, pushing one message to many subscribers at once. Amazon EventBridge routes events to targets based on content, and connects to dozens of AWS services. Amazon Kinesis Data Streams handles ordered, replayable streams that multiple consumers can re-read. You'll often wire them together, for example SNS fanning out into several SQS queues.4. The fanout pattern
That order-reaches-four problem is the fanout pattern, and on AWS it's SNS plus SQS. You publish the event once to an SNS topic, and multiple SQS queues subscribe, so SNS delivers a copy to each queue. Billing, fulfillment, and analytics each get their own queue and process at their own pace, decoupled from one another and the publisher. If one consumer is down, its messages just wait in its queue. That's the backbone of event-driven design on AWS.5. Filtering so consumers get only what they need
By default, every subscriber on a topic gets every message, wasting processing and money. Filtering fixes that. On SNS, a subscription filter policy attached to each subscription inspects message attributes and only forwards matches, so the billing queue can ask for only events where region is us-east-1. On EventBridge, content filters in the rule's event pattern do the same on event fields. Either way, each consumer receives only the events it cares about, and costs drop with it.6. Routing with EventBridge
EventBridge is the router for event-driven systems. Events arrive on an event bus from AWS services, your own applications, or partners. A rule holds an event pattern that describes which events to match, like "every OrderPlaced event over five hundred dollars." When an event matches, EventBridge sends it to the rule's targets: a Lambda function, an SQS queue, a workflow, and more. A single event can fan out to several targets through different rules. This is how you wire cross-service workflows without hardcoding who calls whom.7. Streaming with Kinesis Data Streams
When you need a continuous, real-time flow of data, you reach for Kinesis Data Streams. Unlike a queue, where each message is processed once and removed, a stream is an ongoing feed: producers write records continuously, and consumers read them in near real time as they arrive. Records stay in order within a shard for a retention period, so consumers can re-read from any point instead of losing data after one read, and multiple consumers can read the same stream independently. That fits clickstreams, telemetry, and high-throughput pipelines. A queue gives you decoupling; a stream gives you an ordered, replayable, real-time log.8. Lambda as an event consumer
Lambda ties this together as the consumer, triggered by SQS, SNS, EventBridge, and Kinesis. For SQS and Kinesis, an event source mapping polls the source and invokes your function in batches; you never run a poller. For SNS and EventBridge, the service pushes events to Lambda directly. Either way, you get near-real-time processing with no servers to manage, scaling automatically with event volume. This is the standard way to turn events into useful work on AWS.9. Let's practice!
Your turn to wire up some events. Let's practice!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.