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

Eventgetriebene Architekturen - Einführung in C...

Avatar for Nik101010 Nik101010
July 24, 2023
26

Eventgetriebene Architekturen - Einführung in CQRS/ES mit Axon & Spring Boot

Die Folien des CQRS und Event Sourcing Workshops auf dem Java Forum Stuttgart Workshop Tag 2023

Avatar for Nik101010

Nik101010

July 24, 2023
Tweet

Transcript

  1. 1 @qimono on Pixabay Eventgetriebene Architekturen Einführung in CQRS/ES mit

    Axon & Spring Boot Frank Steimle Nikolai Neugebauer
  2. 2 Goals After this workshop you’ll know: 1. Foundations of

    CQRS/ES a. Components of this architectural style b. Pros and cons 2. Foundations of Axon Framework a. Programming model and components b. Test-driven development with Axon Photo by Afif Kusuma on Unsplash
  3. 3 Agenda Introduction to CQRS/ES Overview Axon Practical Axon Demonstration

    Group Coding / Individual Coding Photo by Matthew Smith on Unsplash
  4. 4 Challenges of 3-tier Architectures R ead W rite Auditability

    domain model data store API message queue
  5. 5 Challenges of 3-tier Architectures R ead W rite Auditability

    domain model data store API We need to track users’ data access for compliance reasons. message queue
  6. 6 Challenges of 3-tier Architectures R ead W rite Auditability

    domain model data store API We need to apply stronger business rules. message queue
  7. 7 Challenges of 3-tier Architectures R ead W rite Auditability

    domain model data store API message queue We need to support mobile apps in addition to our web app.
  8. 8 Challenges of 3-tier Architectures R ead W rite Auditability

    domain model data store API message queue Management wants business dashboards.
  9. 9 Command Query Responsibility Segregation (CQRS) single model Commands (Write)

    Queries (Read) data store ? write model Commands (Write) Queries (Read) read model data store data store projection(s)
  10. 10 CQRS & Event Sourcing (ES) write model Commands (Write)

    Queries (Read) read model event store
  11. 11 CQRS & Event Sourcing (ES) R ead W rite

    Auditability events event store API message queue write model read model CQRS Event Sourcing
  12. 12 1. Open-Source “CQRS/ES Framework” for the JVM a. Java/Kotlin

    Support b. Spring Boot Auto-Configuration c. Reactive Support d. Distributed Tracing Support e. Metrics Extensions 2. Building Blocks for CQRS / Event Sourcing a. Commands b. Events c. Queries 3. Event-Store / Event Sourcing a. Embedded Mode using SQL-Database b. Axon Server c. AxonIQ Cloud 4. Current Version: 4.8 Axon Framework
  13. 13 CQRS/ES with Axon write model Commands (Write) Queries (Read)

    read model event store Aggregate E C Event Handler data store E Event Handler message queue E message queue REST API Q E Commands (Write) write model Queries (Read) read model
  14. 14 Hexagonal Architecture (Ports & Adapters) Domain Web App Database

    REST Controller Database Projector Event Subscription Message Bus Mail Notification Processing Client (REST) Analytics Analytics Data C C E E E E Domain Test(s) Adapter Test(s) Other App
  15. 16 Command Side: Aggregate, Commands & Events Aggregate Message Queue

    REST API Event Store Event Event Event Sourcing Command Command
  16. 17 Live Coding Photo by David Schultz on Unsplash Aggregates,

    Commands, Events https://github.com/dxfrontiers/axon-library #WirStellenEin
  17. 18 Query Side: Event Handler, Query Handler & Queries Aggregate

    Event Event Handler DB Event Handler Event Handler Event Message Queue Query Handler Query Event Handler Projector
  18. 19 Live Coding Photo by David Schultz on Unsplash Specialized

    Read Model via Event Handlers https://github.com/dxfrontiers/axon-library #WirStellenEin
  19. 20 Q&A Eventgetriebene Architekturen Einführung in CQRS/ES mit Axon &

    Spring Boot Nikolai Neugebauer @nik101010 [email protected] Frank Steimle [email protected] https://github.com/dxfrontiers https://blog.digitalfrontiers.de @dxfrontiers https://www.youtube.com/channel/UCZfJc3Y9YO_8i5POMOZ4ktw