Slide 1

Slide 1 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Getting started with Event-Driven Architectures in 2023 Maximilian Schellhorn Senior Solutions Architect Amazon Web Services Dennis Kieselhorst Principal Solutions Architect Amazon Web Services

Slide 2

Slide 2 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon.com Architecture in 1995 Internet Obidos (web server) Customers Inventory Orders Distribution center Amazon.co m CC motel (credit card) Amazon.com Books

Slide 3

Slide 3 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1998 – Distributed Computing Manifesto “The applications (clients) would no longer be able to access the database directly, but only through a well-defined interface that encapsulates the business logic required to perform the function.” https://www.allthingsdistributed.com/2022/11/amazon-1998-distributed-computing-manifesto.html

Slide 4

Slide 4 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scalability S O A – 2 0 0 0 Internet Obidos Distribution Center CC motel Customers Customer service Orders Inventory ACB CustNA Distribution center

Slide 5

Slide 5 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Store products in the warehouse Pick products for customers Report defects Track shipments Product Details DB DB DB DB DB Web of Microservices

Slide 6

Slide 6 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Architecture 2023

Slide 7

Slide 7 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9 Let’s review: Synchronous HTTP microservices

Slide 8

Slide 8 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Microservices with synchronous integration 201 201

Slide 9

Slide 9 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges with synchronous distributed systems Ordering Fulfill Order Payment Loyalty User

Slide 10

Slide 10 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges with synchronous distributed systems Ordering Fulfill Order Payment Loyalty User ERROR: 500

Slide 11

Slide 11 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges with synchronous distributed systems Ordering Fulfill Order Payment Loyalty User Response time: 10 seconds Is the Loyalty service a requirement to complete an order?

Slide 12

Slide 12 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges with synchronous distributed systems Ordering Fulfill Order Payment Loyalty User What happens as the system becomes more complex? CRM

Slide 13

Slide 13 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Long-term architecture? Fulfill Order Payment Loyalty

Slide 14

Slide 14 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven architectures (EDA) An architectural style of building loosely-coupled software systems that work together by emitting and responding to events. 17

Slide 15

Slide 15 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven architectures (EDA) An architectural style of building loosely-coupled software systems that work together by emitting and responding to events. 18

Slide 16

Slide 16 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. event A signal that a system’s state has changed. Immutable facts that have occurred in the past.

Slide 17

Slide 17 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Properties of events • Events are signals that a system’s state has changed • Events occur in the past (e.g. OrderCreated) • Events cannot be changed (immutable) • Decrease coupling by restricting information to key data "source": "com.orders", "detail-type": "detail": "metadata": "idempotency-key": "data": "order-id"

Slide 18

Slide 18 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sparse events vs. full state descriptions 123 10:47 a.m. 456 123 10:47 a.m. 456. Open $57.51. The

Slide 19

Slide 19 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event Driven Architectures 123 10:47 a.m. 456 Event Event broker Fulfill Order Payment Loyalty 123

Slide 20

Slide 20 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. If your application is cloud-native, or large-scale, or distributed, and doesn’t include a messaging component, that’s probably a bug. Tim Bray 27

Slide 21

Slide 21 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Friends don’t let friends rely on synchronous integration Dirk Fröhner Principal Solutions Architect, AWS 28

Slide 22

Slide 22 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. In an event-driven architecture, systems and development teams communicate via events 30 Event broker Producer Event producers are systems that detect a change in state or notice updates and publish those facts. Application code, a database or a time-based trigger can serve as event producers, among other things. An event broker is a meeting place between the producers and consumers. The broker is how events are exchanged. Consumer/ Subscriber Event consumers are systems that listen for events and use them for their purposes. It’s possible, and common, for a consumer to receive an event, perform some work and publish its event in response.

Slide 23

Slide 23 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Different types of channels Point-to-point (queue) Publish-subscribe (topic) Publisher(s) Topic Subscribers Sender(s) Queue Receivers B A C B A C B A C B A C B A C B A C Each message consumed by one receiver Each message consumed by each subscriber

Slide 24

Slide 24 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Implementing EDA in 2023

Slide 25

Slide 25 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless AWS native Point-to-point (queue) Publish-subscribe / fan-out (topic) Publisher(s) Subscribers Sender(s) Receivers Amazon Simple Queue Service (Amazon SQS) Amazon Simple Notification Service (Amazon SNS) B A C B A C B A C B A C B A C B A C

Slide 26

Slide 26 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless was designed for the event-driven model 35 No infrastructure to provision or manage Automatically scale to millions of users Pay per use billing model Highly available and durable OFF

Slide 27

Slide 27 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless was designed for the event-driven model Only run when invoked by events Built-in features and integrations for working with events Focus on business logic, not infrastructure management 36 Paying for idle Capacity cost Capacity utilization

Slide 28

Slide 28 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managed Open Source Point-to-point (queue) Publish-subscribe / fan-out (topic) Publisher(s) Subscribers Sender(s) Receivers Amazon MQ – managed RabbitMQ or Apache ActiveMQ Amazon Managed Streaming for Apache Kafka B A C B A C B A C B A C B A C B A C

Slide 29

Slide 29 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Message routing Message filter Receive only relevant subset of messages Publisher(s) Topic Subscribers C A D B C B D A C B D A

Slide 30

Slide 30 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EventBridge architecture Partner event source Rules Default event bus Custom event bus SaaS event bus Amazon EventBridge

Slide 31

Slide 31 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Introducing Unicorn Properties Our use case is based on a real estate company called Unicorn Properties As a real estate agency, Unicorn Properties needs to 1. manage the publication of new property listings 2. manage contracts linked to individual properties 3. provide a way for their customers to view approved property listings

Slide 32

Slide 32 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Contracts API Property images S3 bucket Agent Contracts table Properties Web API Search function Approval function Publication evaluation event handler Customer Unicorn Properties event bus Properties table Agent Contracts function Unicorn.Contracts Unicorn.Web Contract status table Property Publishing Approval workflow Contract status changed event handler Contract status checker Property approvals sync SendTaskSuccess Unicorn.Properties Wait for contract approval Parameter Store The architecture Unicorn Contracts Unicorn Properties Web Unicorn Properties 1 3 2

Slide 33

Slide 33 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands-on workshop Supported by fully functional reference architectures s12d.com/aws-sde-python s12d.com/aws-sde-ts s12d.com/aws-sde-java s12d.com/aws-sde-dotnet Python TypeScript Java C# Instructions https://catalog.workshops.aws/serverless-developer-experience

Slide 34

Slide 34 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Another example: Managed Care Plan Domain: Provider Management Domain: Patient Care Plan Manage Availability Create Care Provider Profiles Create Patient Profile Search, Manage and Book Care Provider Availability

Slide 35

Slide 35 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS Managed Care Plan running on Kubernetes Streams Care Provider Connect Amazon RDS PostgreSQL provider-schedule service (Spring Boot) care-plan Service (Spring Boot) Patient Amazon RDS PostgreSQL https://github.com/aws-samples/event-driven-careplan-on-eks

Slide 36

Slide 36 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Takeaways In an event-driven architecture, systems and development teams communicate via events. EDAs can give you: • Greater developer agility and extensibility • Increased scalability and fault tolerance • Lower total cost of ownership Serverless services are uniquely compatible with EDA. 53

Slide 37

Slide 37 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Q&A

Slide 38

Slide 38 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Learn more Event-Driven Architectures on Serverless Land • Workshops • Guides • Architecture patterns 55 https://serverlessland.com /event-driven- architecture/intro

Slide 39

Slide 39 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://aws.amazon.com/contact-us/

Slide 40

Slide 40 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Appendix

Slide 41

Slide 41 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lego uses an event-driven design for scalability 58 Commerce platform Order & customer updates Event relay Amazon EventBridge Login Customer login Checkout Submit order Order Process order Shipping Send order to SAP Data sync Customer, VIP, wishlist sync Payment Authorize payment FIFO queue Customer login Invoke every minute Order complete Events Payment authorized Customer login Order complete Order submit • Lego’s traffic spikes on peak days —leading to a 2017 Black Friday crash • An event-driven design scales automatically, eliminating the problem of crashing during peaks

Slide 42

Slide 42 text

GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Processing 8.1M mail items per day with events at PostNL 59 AWS Community Day Benelux 2021