Slide 1

Slide 1 text

Dennis Kieselhorst @ Amazon Web Services Einstieg in ereignisgesteuerte Architekturen in 2023 System Architektur

Slide 2

Slide 2 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Einstieg in ereignisgesteuerte Architekturen in 2023 Dennis Kieselhorst Principal Solutions Architect Amazon Web Services

Slide 3

Slide 3 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Coupling – Integration’s magic word Coupling is a measure of independent variability between connected systems. Decoupling has a cost, both at design and run-time. Coupling isn’t binary. Coupling isn’t one-dimensional. A B Source: EnterpriseIntegrationPatterns.com

Slide 4

Slide 4 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4 Let’s review: Synchronous HTTP microservices

Slide 5

Slide 5 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges with synchronous distributed systems Ordering Fulfill Order Payment Loyalty User Send order to be prepared Update order status Send data for rewards

Slide 6

Slide 6 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 7

Slide 7 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 8

Slide 8 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 if menu item is sold out? Is it available to order? Need to update order? Invalidate?

Slide 9

Slide 9 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 10

Slide 10 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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. 10

Slide 11

Slide 11 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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. 11

Slide 12

Slide 12 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven architectures (EDA) • Architectural style ▪ It’s a mindset, not a list of technologies ▪ EDAs are mostly asynchronous, and eventually consistent • Loosely coupled ▪ Services don’t call one another directly • Systems emit and respond to events ▪ Emitting events is easy ▪ Multiple ways receive/fetch/respond 12

Slide 13

Slide 13 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 15 Event broker

Slide 14

Slide 14 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 15

Slide 15 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event modeling Enable your technology to reflect your business 17

Slide 16

Slide 16 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 17

Slide 17 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 19 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 18

Slide 18 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven architectures enable 20 An accelerated pace of innovation with increased developer agility and speed of new feature release A quicker path to modernization by ingesting events from existing systems to build new applications and functionality Better customer experiences with the ability to scale to handle unexpected peaks and fewer single points of failure

Slide 19

Slide 19 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 20

Slide 20 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless was designed for the event-driven model 22 No infrastructure to provision or manage Automatically scale to millions of users Pay per use billing model Highly available and durable OFF

Slide 21

Slide 21 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 23 Paying for idle Capacity cost Capacity utilization

Slide 22

Slide 22 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event brokers Queues • Amazon Simple Queue Service (SQS) • Amazon MQ (for Apache ActiveMQ and RabbitMQ) Streams • Amazon Kinesis • Apache Kafka/ Amazon Managed Streaming for Apache Kafka (MSK) Routers • Amazon EventBridge • Amazon Simple Notification Service (SNS) 24 Pull-based Push-based

Slide 23

Slide 23 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 24

Slide 24 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 25

Slide 25 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. The architecture Unicorn Contracts Unicorn Properties Web Unicorn Properties 1 3 2 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

Slide 26

Slide 26 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 27

Slide 27 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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. 33

Slide 28

Slide 28 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 29

Slide 29 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 35 https://serverlessland.com /event-driven- architecture/intro

Slide 30

Slide 30 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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.

Slide 31

Slide 31 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN 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 32

Slide 32 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lego uses an event-driven design for scalability 38 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 33

Slide 33 text

EINSTIEG IN EREIGNISGESTEUERTE ARCHITEKTUREN IN 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Processing 8.1M mail items per day with events at PostNL 39 AWS Community Day Benelux 2021