$30 off During Our Annual Pro Sale. View Details »

Einstieg in ereignisgesteuerte Architekturen in 2023

Einstieg in ereignisgesteuerte Architekturen in 2023

Ereignisgesteuerte (event-driven) Architekturen sind nicht neu und versprechen schwierige Herausforderungen in modernen Anwendungslandschaften zu lösen. Du fandest den Ansatz schon immer interessant, bist aber bislang nie zur Umsetzung gekommen? Die Technologieauswahl ist überwältigend und du bist unsicher, ob es dafür bspw. einen Service Bus, eine Process Engine oder eine andere Art von Integrationskomponente braucht?

Besuche unseren Vortrag um zu lernen, wie du ereignisgesteuerte Architekturen heutzutage zeitgemäß implementieren kannst. Wir beginnen mit einem Rückblick auf Enterprise Integration Patterns und schauen uns im Anschluss eine Beispielimplementierung in Java an. Du verlässt den Vortrag mit dem Link zu einem öffentlichen Git-Repo, das Code und Anweisungen enthält, um es im Nachgang auch selbst ausprobieren zu können. Java ist nicht deine Lieblingssprache? Wir stellen alternativ auch Repos mit .NET-, Python- und TypeScript-Beispielen bereit.

Dennis Kieselhorst

September 15, 2023
Tweet

More Decks by Dennis Kieselhorst

Other Decks in Technology

Transcript

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

    View Slide

  2. 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

    View Slide

  3. 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

    View Slide

  4. 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

    View Slide

  5. 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

    View Slide

  6. 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

    View Slide

  7. 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?

    View Slide

  8. 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?

    View Slide

  9. 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

    View Slide

  10. 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

    View Slide

  11. 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

    View Slide

  12. 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

    View Slide

  13. 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

    View Slide

  14. 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.

    View Slide

  15. 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

    View Slide

  16. 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"

    View Slide

  17. 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.

    View Slide

  18. 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

    View Slide

  19. 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

    View Slide

  20. 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

    View Slide

  21. 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

    View Slide

  22. 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

    View Slide

  23. 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

    View Slide

  24. 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

    View Slide

  25. 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

    View Slide

  26. 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

    View Slide

  27. 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

    View Slide

  28. 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

    View Slide

  29. 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

    View Slide

  30. 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.

    View Slide

  31. 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

    View Slide

  32. 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

    View Slide

  33. 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

    View Slide