Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting started with Event-Driven Architectures in 2023 (Øredev)

Getting started with Event-Driven Architectures in 2023 (Øredev)

Event-driven architectures are not new and can solve many difficult problems in modern enterprise workloads. You always found them interesting but never managed to implement one? The technology choices are overwhelming for you? You are confused if you need a service bus, a process engine or a different type of integration component for it?

Join this session to get started with Event-Driven Architectures in 2023. We’ll start with a recap of enterprise integration patterns and walk you through an example implementation in Java afterwards. You’ll leave with a public Git repo containing code and instructions so you may also run through it on your own. Java is not your favorite language? We’ll also provide repos with .NET, Python and TypeScript examples.

Dennis Kieselhorst

November 09, 2023
Tweet

More Decks by Dennis Kieselhorst

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. GETTING STARTED WITH EVENT-DRIVEN ARCHITECTURES IN 2023 © 2023, Amazon

    Web Services, Inc. or its affiliates. All rights reserved. Amazon Architecture 2023
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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?
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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.
  17. 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"
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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.
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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/
  40. 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
  41. 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
  42. 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