Uploaded by Victor Matheus Santos Batista

EventBridge Visuals 0 0 2 1687888471

advertisement
Serverless Visuals: Small bite sized visuals about Amazon
EventBridge
David Boyne
v0.0.2
2
EDA Visuals
3
About Serverless Visuals
Serverless Visuals was designed to help visual learners learn about AWS services. This visual guide
is focused on Amazon EventBridge, and goes through various levels of content to help you learn the
basics and advanced topics.
This document is organic, every time new visuals are uploaded online this document will be generated
and uploaded. (so make sure you keep coming back to check for updated versions).
I truly believe event-driven architectures can transform organisations and I hope you find these
notes and visuals useful.
David Boyne
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
4
About David Boyne
My name David Boyne and I’m a Developer Advocate at AWS focusing on event-driven architectures
and serverless technology. I dive deep into event-driven architectures and create content online to help
others. I have also created many open source projects to help you manage event-driven-architectures
(e.g. https://eventcatalog.dev).
If you want to learn more or keep up to date with updates feel free to connect with me.
• Twitter: @boyney123
• LinkedIn: https://www.linkedin.com/in/david-boyne/
• GitHub: https://github.com/boyney123
• Website: https://www.boyney.io/
• My Open source projects: https://www.boyney.io/projects
Speaking at Events
If you are interested in having me speak at your upcoming events, I would be happy to
discuss the possibility. Whether it’s a conference, podcast, seminar, workshop, please feel free to
contact me.
Thanks for downloading this content, I hope it can help.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
5
Table of EventBridge Visuals
What are events?
6
Understanding an EventBridge bus
9
Understanding EventBridge targets
11
What are EventBridge rules?
14
Event Patterns: Filtering events with Rules
17
Event Patterns: Prefix filtering
20
Event Patterns: Suffix filtering
21
Event Patterns: Anything-but filtering
22
Event Patterns: Numeric filtering
23
Understanding API destinations
25
EventBridge schema registries
27
Archive your events and replay them
29
Scheduling events with EventBridge Scheduler
31
Learn event-driven architecture today
33
Start coding with Amazon EventBridge using serverless land patterns
35
Dive deeper into Amazon EventBridge
36
Summary
37
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
6
What are events?
Figure 1: What are events?
Events are at the heart of an event-driven architecture. Think of the event as an envelope of
information you can publish across your architecture. What goes into the event payload is up to
you, so it’s important to consider what information you put in.
Events are often published by producers and downstream consumers react to the events and process
them.
Events at the heart
• Events are the core of an event-driven architecture, use events or messages to communicate
between services
• Events/messages allow services to remain decoupled, we can use services like Amazon EventBridge to process events for us. We publish events to an event bus and EventBridge handles
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
7
configured rules and consumers.
Service events vs custom events
• When you build event-driven architectures on AWS with EventBridge you can consume service
events or raise your own custom events.
• Service events allow to react to AWS service events. Example would be when an item is create
in Amazon S3, you can setup downstream consumers to react to this event/notification.
• EventBridge also allows you to create custom events. These can be business events or domain
events. Raising important business critical events can help you build decoupled event-driven
architectures. An example of this would be raising an OrderCreated event when a new order
has been created, and letting downstream or external systems consume this event and then
process the order.
• Remember if you are writing custom events, it’s important to consider your event design and
best practices.
Event design is important
• When designing events, the name and payload of the events is up to you, so it’s important to
consider what information needs to go into your event.
• Make sure your naming conventions are implicit. Make sure your event names are clear and
the intent of the event can be determined by reading the event name itself. This can help with
consumer discoverability.
• Use workshops like Event Storming to help identify events and start to agree on standards
within your teams / domains and organizations.
Event Types
• When raising custom events you can choose which type of event you want to raise. These are
explicit but you can determine which type of event you want to raise by the information you
put into your event
• Notification events are small events, designed to notify downstream consumers. These tend
to be small in contract and downstream consumers may request more information from the
producer or another API to get information required.
• Event-carried state transfer events tend to have more information inside them. They are rich
in content and downstream consumers often have the information they need. Remember when
using EventBridge, you can use filters to filter events before they reach downstream consumers,
information inside the events can help with this, but understand the trade-offs with your event
design.
• Delta events provide consumers information of the state before and after something has
happened. An example of this would be a ShoppingCartUpdated event, you can share with
consumers the total cost of the shopping cart before/after items are removed. This allows
downstream consumers to remain simple and not need to calculate any deltas themselves.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
8
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Commands vs Events - When you dive into event-driven architecture you will see the terms
commands and events. Understanding the differences here is important.
• Event first thinking - It’s easy to just raise events and put minimal design thought into your
events, you may run into issues later on though. Treat events as first class citizens, this visual
can help you understand more.
• Explicit vs Implicit events - Don’t let consumers guess what your events do, make clear implicit
event naming conventions to help.
• Exploring event types - Dive deeper into event types, understand the tradeoffs between them.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
9
Understanding an EventBridge bus
Figure 2: Understanding an EventBridge bus
The event bus is at the heart of Amazon EventBridge. Producers raise events onto their event bus
and rules are configured to trigger downstream consumers.
Event bus is a key component
• The event bus gives you a event-driven pattern that allows you to publish events and push
these events to any downstream consumer that is interested/listening.
• With Amazon EventBridge you can use the default event bus (every account has one) or create
your own event bus.
• All events produced and consumed go through the event bus. Think of the event bus as the
master of your events, it understands where events should go (using rules and targets), and
can also provide you detailed schema information for your events (using schema discovery).
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
10
Default bus and custom buses
• All AWS accounts have an EventBridge bus (the default one), AWS services raise events to
this default event bus which you can consume and react to various different changes/events
that occur in services. (e.g. S3 events (if you have them configured), Tag resource changes,
CloudTrail events, EventBridge schema changes, and many more. . . )
• You also have the option to create custom event buses, many developers create custom event
buses to map to their domains or accounts. Using multiple buses allows you to build multi
bus and/or multi account topologies using event buses (watch this great talk on event bus
topologies).
Route events across AWS accounts
• Many developers are using cross account events. Each domain has it’s own AWS account and
EventBridge can send events to other buses in different accounts. This allows you to create a
topology to send events between boundaries and domains.
Integration with many services
• One of the best parts of EventBridge is the ability to target many different AWS services
(called targets, also known as consumers). Publish an events, setup a rule and target to trigger
a downstream consumer (e.g. Lambda function, Step Functions workflow, Event bus, and
more).
• If you ever want to debug a particular rule, you can always setup a CloudWatch target, to
listen to all your events to help you debug a particular rule or event bus.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
• Designing event-driven integrations using Amazon EventBridge - Stephen Liedig gives us a
great talk on designing event-driven integrations using Amazon EventBridge. Here Stephen
goes into event bus topologies, something you might want to consider and learn.
• Debug EventBrige events - A blog post I wrote awhile ago to help you debug and see your
events using a simple CloudWatch rule.
• Understanding EventBridge Rules - Visual here to help you learn more about EventBridge
Rules and why they are so powerful when attaching them to your event bus.
• Understanding EventBridge Targets - Visual to help you learn about EventBridge Targets
(consumers), attach Rules and Targets to your event bus.
• EventBridge Patterns - Over 100 patterns to get started with EventBridge, see the code and
get building.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
11
Understanding EventBridge targets
Figure 3: Understanding EventBridge targets
When building event-driven applications, you may want to publish events to downstream consumers.
Amazon EventBridge allows you to configure rules and targets to create consumers of events.
Amazon EventBridge allows you to listen to events raised in various AWS Services, and also create
and publish your own custom events. Once an event is published to your event bus, EventBridge
will process these events and trigger your downstream consumers (targets).
What are Targets?
• When you publish an event, you want a downstream consumer to react. Targets are consumers
of your events.
• A target cannot live without an EventBridge rule. Rules process events before they reach
downstream targets.
• When an event triggers a rule all of the targets associated with the rule are invoked (unless
you have filtering setup on your rule)
• Targets are services, resources or end points you want your event to trigger (read the full list
here).
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
12
• Targets can also be services in other AWS accounts or Regions. This allows you to setup multi
bus topologies within your architecture. Read more.
Target Permissions
• Your EventBridge bus will need permissions to trigger downstream targets.
• To make API calls against the resources you own, EventBridge needs the appropriate permissions. For Lambda, Amazon SNS, Amazon SQS, and Amazon CloudWatch Logs resources,
EventBridge uses resource-based policies. For Kinesis streams, EventBridge uses identity-based
policies. You can read more here.
Fan out to many services
• EventBridge is a fully managed serverless service that allows you to fan out events to downstream consumers. (also known as publish/subscribe pattern)
• Using events you can notify downstream consumers that something has happened. These
producers of events can be AWS service events or even custom events.
• Custom events are powerful. They allow you to notify downstream consumers that
something has happened. These can be important business domain events, or maybe technical
events. When developing your events it’s important to understand event design and the
different types of events you may raise.
Targets with additional properties
• EventBridge supports 28+ different targets, these can be AWS Services and also external
APIS using API Destinations.
• Depending on what target you configure, you may have the option to add additional configuration to your targets.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Publishing events without targets - When publishing events, you may not know of downstream
consumers, or even have any, but one great practice of EDA is you may want to publish events
without any consumers (yet). This visual helps you understand more.
• Using EventBridge with legacy applications - Event driven applications are not just for green
field projects, but using events can help you migrate off legacy systems. Maybe Amazon
EventBridge can help you here with your migration into the cloud?
• Flow Architectures - Great book by James Urquhart about how events can and will be used
to communicate between organisations, when using EventBridge you may want to explore
API Destinations being able to trigger internal/external APIS with your events, creating and
moving to a flow architecture.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
13
• What are producer and consumer responsibilities? - When building your EDA application
your producers and consumers will have their own set of responsibilities, this visual can help
you understand more.
• Understanding event types - When you publish events, there are many types of events to
consider, this visual helps you understand them and dive deeper.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
14
What are EventBridge rules?
Figure 4: What are EventBridge rules?
Amazon EventBridge rules allow you to route events on your EventBridge bus to targets. Producers
can publish events to EventBridge, but they will only be consumed by consumers when rules and
targets are configured.
Think of EventBridge rules as the router between your events and downstream consumers.
Your rules understand which consumers to trigger (these are EventBridge targets). Rules may also
have filters on them, this allows events to be filtered and only trigger downstream consumers when
these patterns match.
What are EventBridge rules?
• Rules allow you to route events that arrive on your event bus to downstream consumers.
• Rules can be configured with filters (using event patterns). Use this to trigger consumers when
a particular event or details in the event match your use case.
• Rules can have up to 5 targets (consumers). When an event matches a rule, the downstream
targets are triggered in parallel (pub/sub pattern).
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
15
• When rules fail to deliver events to a target, the default retry period is 24 hours, until the
event is dropped or configured on a dead-letter queue (DLQ).
Filter with event patterns
• Using rules you can filter events to your downstream consumers. Many publishers may be
producing events, you can listen to these, filter them (e.g. by name or property in the event),
and then trigger consumers
• Filtering is a great way to consume only the events your consumer wants to know about, and
gives the ability to be flexible with filtering options.
Route events that arrive on the bus
• Think of rules as routers, they understand what the events are, if they should be filtered and
forwarded onto the consumers. Rules control the information if consumers are triggered or not.
• Rules can be enabled or disabled. Keep this in mind if you ever want to turn a rule on or off.
• There are three rule types, Managed, Standard and Scheduled. Managed rules are owned by
the EventBridge service. Standard rules are rules managed by you with pattern matching
and Scheduled rules allow you to trigger targets on time schedules. If you are interested in
scheduled rules it’s worth checking out Amazon EventBridge Scheduler.
Rules and Targets
• Rules are configured on the Event Bus, and targets (consumers) are configured on the rules.
• Targets are attached to rules. The rule routes events to downstream consumers (targets).
• You can have 5 targets per rule, each target will be triggered in parallel. This is known at
the publish/subscribe pattern. Notify downstream consumers that something interesting has
happened.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
• Publish events without consumers? - Remember you can still publish events without any rules
or consumers, this might be a pattern you may want to explore. This visual can help you
understand more.
• What happens with delivery of events fail? - When building event-driven architectures events
can fail to reach downstream consumers, how can you handle that? Dive in and find out more.
• Internal vs External Events - When you have your services/domains you may be raising
internal or external events, having rules that are internal to your domain or external by other
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
16
teams. Knowing the difference between these can help. Remember to think about what goes
into your event payloads.
• Document your event-driven architecture - When you start building consumers, targets, rules
and event buses, you may want to consider documentation. There will come a point where
your producers and consumers scale, and it can become hard to discover events, schemas,
producers and consumers.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
17
Event Patterns: Filtering events with Rules
Figure 5: Event Patterns: Filtering events with Rules
When you are building serverless event-driven architectures with Amazon EventBridge, you may
want to filter your events before they reach downstream consumers.
EventBridge rules process events before they reach downstream consumers (targets) and use event
pattern matching to work out if your consumer should be triggered or not. This is a powerful
feature, as it allows you to trigger customers only when certain conditions are met.
Filter your events
• Use EventBridge event pattern matching in rules to filter your events, the rules will process
the events and only forward events to consumers if the criteria by your filter is matched.
• EventBridge supports a wide range of filters (e.g Preffix, Suffix, anything-but, numeric and
much more. . . ). It’s worth reading them and understanding what filter patterns you can use
to help build your EDA applications.
• One thing to consider is someone has to manage your EventBridge Rules (and filters), this can
be your consumers, or for some users this may be your DevOps team. Make sure you have
clear responsibility of who manages these rules and filters. The producer should not really
care about who is consuming their events (at the technical level anyway, but remember you
may care as an organization who is producing and consuming what).
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
18
Filter with patterns
• EventBridge supports many filtering options for you. You specify these using “Event Patterns”.
When events match your specified pattern, the event will be forwarded to your consumer.
• It’s quite common to match on source and detail type, these would be the names of your
events. For example you can match on OrderCreated event (OrderCreated would be the
detail-type of the event). If your consumers are interested in particular events, for example
orders created over $100, you could you filters like numeric matching filter to help.
Separation of concerns
• Let EventBridge rules do the filtering for you vs filtering in your consumers (where you can).
Having the filtering logic outside of your consumers allows you to keep your consumers simple
and not worry about any filtering logic.
• Any code we write we have to maintain, if the first thing your consumer is doing is filtering
EventBridge events, then maybe you can move this logic into your rules, have EventBridge
manage this for you and let your consumer focus on the logic it needs too.
• Make sure you have rule ownership, who owns the rules for your event bus? Is it the consumer
or someone else (some folks have DepOps teams control EventBus rules)? Have Rule ownership
in your EDA architecture, as time goes on this can help you scale your architecture and not
lead to unwanted side effects of ownership.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
• What is suffix matching - Understand suffix matching, when you can match values at the end
vs the start (prefix).
• What is prefix matching - Understand prefix matching, when you can match values at the
start vs the end (suffix).
• What is anything-but matching - Understand anything-but matching, match events on anything
expect what is provided by this filter.
• Understanding EventBridge Rules - If you want to learn more about EventBridge rules, here
is a visual that can help you.
• What are EventBridge Targets? - Targets are consumers of your events, this visual dives abit
deeper with resources to learn more.
• Publishing events without targets - When publishing events, you may not know of downstream
consumers, or even have any, but one great practice of EDA is you may want to publish events
without any consumers (yet). This visual helps you understand more.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
19
• What are producer and consumer responsibilities? - When building your EDA application
your producers and consumers will have their own set of responsibilities, this visual can help
you understand more.
• Understanding event types - When you publish events, there are many types of events to
consider, this visual helps you understand them and dive deeper.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
20
Event Patterns: Prefix filtering
Figure 6: Event Patterns: Prefix filtering
• EventBridge pattern matching is a feature in Amazon EventBridge that allows you to filter
incoming events based on specific criteria.
• Prefix matching is a type of pattern matching where you only match events whose specified
attribute values start with a given string.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
• What is suffix matching - Understand suffix matching, when you can match values at the end
vs the start (prefix).
• What is anything-but matching - Understand anything-but matching, match events on anything
expect what is provided by this filter.
• What is numeric matching - Filter your events with numbers. Use the =, > or < operators.
This visual explains more.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
21
Event Patterns: Suffix filtering
Figure 7: Event Patterns: Suffix filtering
• EventBridge pattern matching is a feature in Amazon EventBridge that allows you to filter
incoming events based on specific criteria.
• Suffix matching is a type of pattern matching where you only match events whose specified
attribute values end with a given string.
Extra Resources
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
• What are filters? Why are the important - This visual can help you understand what are
EventBridge filters with Rules and why they are important when building EDA applications.
• What is prefix matching - Understand prefix matching, when you can match values at the
start vs the end (suffix).
• What is anything-but matching - Understand anything-but matching, match events on anything
expect what is provided by this filter.
• What is numeric matching - Filter your events with numbers. Use the =, > or < operators.
This visual explains more.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
22
Event Patterns: Anything-but filtering
Figure 8: Event Patterns: Anything-but filtering
• EventBridge pattern matching is a feature in Amazon EventBridge that allows you to filter
incoming events based on specific criteria.
• Anything-but matching is a type of pattern matching where you match events on anything
expect what is provided by this filter.
• Example in the visual shows two Payment events. One that failed and one the succeeded.
The EventBridge rule here will filter events that match anything but succeeded. This means
all events that are not succeeded will match the rule, and the events will be forwarded to
downstream consumers.
• Remember you can also use anything-but with prefix matching. Read more in the docs.
Extra Resources
• What is suffix matching - Understand suffix matching, when you can match values at the end
vs the start (prefix).
• What is prefix matching - Understand prefix matching, when you can match values at the
start vs the end (suffix).
• What is numeric matching - Filter your events with numbers. Use the =, > or < operators.
This visual explains more.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
23
Event Patterns: Numeric filtering
Figure 9: Event Patterns: Numeric filtering
• EventBridge pattern matching is a feature in Amazon EventBridge that allows you to filter
incoming events based on specific criteria.
• Numeric matching is a type of pattern matching where you match events on numeric values,
you can use the = and < > operators.
• Example in visual shows two UserCreated events with the property age in the event detail.
The filter in the rule matches any event where the age is between 30-39. Any users that
are between 30-39 will get forwarded to the consumer (target).
• You can use the >, < and = operations with numeric filters. Examples would be give me all
users that at exactly 20 (= 20), or users that are greater than 20 years old (> 20), or less than
20 years old (<). You can use a combination of these filters to get more granular filtering on
your events.
Extra Resources
• What is suffix matching - Understand suffix matching, when you can match values at the end
vs the start (prefix).
• What is prefix matching - Understand prefix matching, when you can match values at the
start vs the end (suffix).
• What is anything-but matching - Understand anything-but matching, match events on anything
expect what is provided by this filter.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
24
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
25
Understanding API destinations
Figure 10: Understanding API destinations
API destinations are a great feature of Amazon EventBridge, that allow you to forward your events
to consumers through HTTP. If you have an internal or external API that wants to receive events
through EventBridge you can configure a rule and create a API destination to route events to this
consumer.
Route events to an API using HTTP
• API destinations allows you to forward events from EventBridge to any HTTP API.
• API Destinations supports many different HTTP methods (e.g. POST, PUT, GET, DELETE),
which can be configured when you create your API destination.
• Event-driven architectures allow us to connect services together using events, with API
destinations we can even look beyond our boundaries and integrate with external APIS or
SAAS applications that you may need to integrate with.
Transform into expected contract
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
26
• EventBridge allows us to trigger custom events. These events can be specific in domain and
schema to particular domains and micro services. Using input transforms you can transform
payloads before they reach the API consumer.
• APIS expect many different contracts and schemas, use input transformers on your API
destination to transform event payloads before they get send to the API.
What are connections?
• Connections specify the authorization type and parameters to use when connecting to the
API.
• With connections you can use Basic auth, OAuth or API Keys.
• For Basic and API Keys EventBridge will populate the required authorization headers for you.
• Connections give EventBridge the ability to information required to connect to secure API
urls.
Configure invocation rates
• When integrating with 3rd party APIS, the ingestion rate might be different to the number
of events that are being triggers and want to be consumed. API destinations allows you to
configure this ingestion rate, making sure you don’t put too much pressure onto downstream
consumers.
• If you set the invocation rate, EventBridge will manage this for you and only give your
downstream consumer the number of events per second that you have configured. The default
is 300 per second.
Extra Resources
• Learn more about API Destinations - Dive into the AWS documentation to learn more about
API destinations and how you can get started.
• Get coding with API Destinations - Start exploring how to code API destinations, Serverless
land has many patterns you can start exploring.
• Using API destinations with Amazon EventBridge - Dive deeper into API destinations with
this AWS compute blog.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
27
EventBridge schema registries
Figure 11: EventBridge schema registries
When building event-driven architectures, schemas are at the heart of it all. We use events to
communicate between systems, these events have contracts that producers and consumers consume,
we may be decoupled by design, but there is always some form of coupling through event contract
itself.
Schemas and schema registries can help us discover, understand and validate events in our architecture.
The power of schemas
• As your event architecture grows, you will need the ability for developers to discover your
events and what is inside the payload of these events. Schemas can help people understand
events.
• Schemas are a great way to validate payloads for events. If you want to validate events either
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
28
from the producer or consumer you can use the schema to check if the contract is valid.
EventBridge schema registries
• EventBridge supports a few types of schema registries, AWS Schemas, Discovered schemas
and custom registries.
• Every account has a default EventBridge event bus, and AWS services are pushing events into
the bus. If you want to dive deeper you can use the AWS Schemas registry to find events, and
understand the payload of these.
• Discovered schemas is a feature of EventBridge, that allows EventBridge to automatically
detect and create schemas on your behalf as they are published through your event bus.
• You can also create your own schema registry and store your own custom schemas.
Discovered schema registry
• When you enable this feature, EventBridge will automatically create schemas on your behalf,
as they go through your Event Bus. This feature allows developers to explore and understand
events that are going through the event bus.
• Discovered schema registries are a great way to keep track of all events going through your
event bus, and provide a way to discover and understand these events.
Download code bindings
• EventBridge schema registries also give the ability to download code models generated from
your schemas. Pick which event you are interested in and download this model directly into
Java, Python, TypeScript or Go.
Extra Resources
• Amazon EventBridge Schemas - Dive deeper with the AWS documentation. Learn about
schemas, registries and code bindings.
• Download code bindings directly into your IDE - You can use the AWS Toolkit for VS Code
to download code bindings directly into your IDE.
• Schema management - Dive deeper into schemas and ways to document your events.
• Internal vs External events - Are you raising internal or external events? The contract of these
events is important, but differ. Understanding the difference can help you manage the events
and the schemas for these events.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
29
Archive your events and replay them
Figure 12: Archive your events and replay them
EventBridge archive and replay gives you the ability to capture events and store them to replay
at a future date, using archives you can store and access past events. Example use cases could be
replaying test events in your architecture, replaying production load into your event bus to simulate
and test and also hydrate dev/test environments. When you replay events you can also specify
which rules to run your events through, this can give you flexible options to test specific downstream
consumers with a collection of past events.
EventBridge Archive
• Think of an archive as a collection of past events that you want to store.
• When you configure an archive on your event bus, EventBridge will store events into this
archive matching your criteria (filters/rules).
• When setting up an archive you can collect all events that go through an event bus or target
specific events and only store those.
• You can specify how long you want to store your events into the archive (in days) or you can
keep them indefinite (2 billion days!).
EventBridge replay
• When you replay events, you have to specify the source (which archive to play events from)
and the event bus to replay them into.
• The events you archive must be replayed into the same event bus in which you collected them
(for now).
• You can specify a time window in which you want to replay the events into the bus.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
30
• You can also pick which event bus rules you want to replay the events into. This allows you to
test rules or be specific in the rules you want to test. This could be great to replay events into
a specific consumer.
• Replayed events will have extra metadata on them (replay-name), this is added by EventBridge
to know which events are the original and which are replayed events.
Extra Resources
• Amazon EventBridge archive and replay - Dive deeper with the AWS documentation.
• Watch a short video on archive and replay - Developer Advocate James Beswick dives into
archive and replay in this short 6 minute video.
• Read the blog to dive deeper - Detailed blog explaining more, to help you dive deeper if you
need too.
• What are events? - What should you be archiving? It might help to dive deeper into events,
and understanding the various different types of them.
• Setup rules for your archive, but what are rules? - This visual helps you understand EventBridge
rules.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
31
Scheduling events with EventBridge Scheduler
Figure 13: Scheduling events with EventBridge Scheduler
Amazon EventBridge Scheduler allows you to create, run and manage scheduled tasks at scale.
EventBridge Scheduler is super flexible as it allows you to target up to 270+ AWS Services and
6000+ API calls.
Scheduling forms part of many modern-day applications, for example the ability to schedule a user’s
subscription removal after they cancel their subscription at a future date, or schedule developer
tasks, maybe CI/CD tasks you want to perform. Either way scheduling is everywhere. EventBridge
scheduler is great as it allows to create millions of schedules to help build modern event-driven
applications.
Create millions of schedules
• Each supported region can create 1,000,000 schedules per account (which can be adjusted).
• Example use case could be setting up schedules for your users. Think of a chat application for
example, and you want to give your users the ability to schedule the message being sent vs
straight away, you can setup a one-time schedule to be able to do this, per user.
• Schedules can also be grouped using schedule groups. Which provide a way to manage
schedules.
Trigger 260+ services and 6000+ APIs
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
32
• Scheduler supports Universal targets that you can use to create triggers that target more than
260 AWS services and 6,000 API operations. This makes scheduling super flexible.
• Examples could be setting up a schedule to raise an event on EventBridge, triggering a Lambda
function, Creating S3 buckets, start/stop container deployments, start step functions workflow
and much more.
• If you want to learn more, I recommend going to the AWS console and creating a schedule
and exploring the API calls that are possible.
Resilient with managed retires and dead-letter queues
• Great feature here, the ability to configure retry policies on schedules. If your target is down,
then EventBridge scheduler can retry with configured backoff. This allows you to hand over
the retry logic to the service before the event/message is dropped.
• If you want to capture your event before it is dropped you can setup a dead-letter queue to
capture these failed events for future processing.
Time zone support
• Scheduler supports rate-based schedules, cron-based schedules and one-time schedules. For
cron-based schedules and one-time schedules you can configure the time zone.
• Time zone support allows you to trigger events closer to where your users live, making dealing
with time zones easier for triggering jobs/events.
• Scheduler uses the Time Zone Database
Extra Resources
• Dive deeper into EventBridge Scheduler - Dive deeper with the AWS documentation, learn
more about targets, security, monitoring and much more.
• Serverless Office Hours with EventBridge Scheduler - Watch the episode on Serverless office
hours, where Julian Wood and Oluwaseun Ademuwagun dive deeper into the Scheduler, and
how it works.
• Learn more through visuals - Dive deeper into EventBridge with the EventBridge visuals.
Learn about filtering, buses, events and much more.
• EDA Visuals - Explore over 40 visuals about event-driven architectures, learn the fundamentals
and advanced concepts. Dive deeper and explore resources linked to every resource.
• Awesome EventBridge - A list of resources from blogs, videos and examples all about EventBridge. Feel free to explore or even contribute to the list.
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
33
Learn event-driven architecture today
If you want to learn more and get started building event-driven architectures on AWS, here are a
few resources that can help you.
EDA Guide on Serverlessland.com Serverlessland.com hosts over 400 AWS Serverless patterns,
60 Step Functions workflow patterns and over 40 serverless code snippets, we also have a new EDA
section to help the community learn more about building event-driven architectures. If you want to
know more you can visit https://serverlessland.com/event-driven-architecture/intro
Figure 14: Learn event-driven architecture on Serverlessland.com
30 Days of Serverless and EDA For those who want to get hands on building serverless eventdriven-architectures on AWS, we have created a new program for 30 days of Serverless. These are a
collection of videos we have put together to help you learn serverless and event-driven-architectures
from the ground up. If you want to learn more you can visit https://serverlessland.com/reinvent2022/
30dayssls
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
34
Figure 15: Learn event-driven architecture on Serverlessland.com
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
35
Start coding with Amazon EventBridge using serverless land
patterns
If you want to start coding with Amazon EventBridge, ServerlessLand.com has over 100 patterns to
get started.
https://serverlessland.com/patterns?services=eventbridge
These examples include deploying with Serverless Application Model (SAM), CDK, Terraform and
much more.
Figure 16: Start building with ServerlessLand patterns
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
36
Dive deeper into Amazon EventBridge
If you want to dive deeper into Amazon EventBridge with tutorials, videos, blogs, tools and much
more, you can check out the open-source project Awesome EventBridge.
This is a collection of learning resources for you to dive deeper into EventBridge, collection is open
source and welcomes contributions.
https://github.com/boyney123/awesome-eventbridge
Figure 17: Awesome EventBridge
Visuals and thoughts by David Boyne (@boyney123)
EDA Visuals
37
Summary
Serverless Visuals are a colletion of visuals to help you learn AWS services. This visual guide is
focused onAmazon EventBridge.
You can use the visuals to help you get a high level overview of Amazon EventBridge, and use the
resources to dive deeper.
The visuals in this document are from https://serverlessland.com/serverless/visuals/eventbridge
and this document will be generated again with every new visual added.
Hopefully you find this content useful, and feel free to connect with me if you want to learn more.
• Twitter: https://twitter.com/boyney123
• LinkedIn: https://www.linkedin.com/in/david-boyne/
• GitHub: https://github.com/boyney123
Visuals and thoughts by David Boyne (@boyney123)
Download