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

EventSourcing.Live 2021 - A system with thousan...

EventSourcing.Live 2021 - A system with thousands of event types

In the last 10 years we have applied event sourcing and CQRS in the development of our new ERP system. We now have almost two years of production experience. During these years we have run into interesting challenges that needed to be solved. In this session we share how we built a system with many thousands of event types, with the aim of serving thousands of companies and eventually millions of users.

Michiel Overeem

October 07, 2021
Tweet

More Decks by Michiel Overeem

Other Decks in Technology

Transcript

  1. Person Entity Customer Role Order Agreement party Spending limit Address

    Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit
  2. Person Entity Customer Role Order Agreement party Spending limit Address

    Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit • Functional model • Only suitable for ERP • Variability in the model • Contains 25 years of knowledge 22 25 96
  3. Person Entity Customer Role Order Agreement party Spending limit Address

    Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit Generate ERP software
  4. Person Entity Customer Role Order Agreement party Spending limit Address

    Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit
  5. Data QueryModel Object StreamItem Aggregate EventHandler Projector Command Event (Nr=1)

    Event (Nr=2) Event (Nr=3) Query Plain and simple CQRS & event sourcing
  6. StreamItem Aggregate StreamItem Aggregate StreamItem Aggregate Data QueryModel Object StreamItem

    Aggregate EventHandler Projector Command Event (Nr=1; Id=C) Event (Nr=1; Id=B) Event (Nr=1; Id=A) Query Event (Nr=1; Id=1) Event (Nr=1; Id=2) Event (Nr=2; Id=1) Aggregate Aggregate Aggregate StreamItem Aggregate Data QueryModel Object Data QueryModel Object EventHandler Projector Data QueryModel Object Data QueryModel Object Query Command
  7. Data QueryModel Object StreamItem Aggregate EventHandler Projector Command Event (Nr=1)

    Event (Nr=2) Event (Nr=3) Query 3687 11646 4915 1377 1050
  8. Event Store stats 34.106.336 events from 3469 event types Started

    with 8 customers, currently at 91 customers 0,00 5.000.000,00 10.000.000,00 15.000.000,00 20.000.000,00 25.000.000,00 30.000.000,00 35.000.000,00 40.000.000,00 Total # of events
  9. Person Entity Customer Role Order Agreement party Spending limit Address

    Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit A change here Or here … Or here … Impact!
  10. Data QueryModel Object StreamItem Aggregate EventHandler Projector Command Event (Nr=1)

    Event (Nr=2) Event (Nr=3) Query StreamItem ProcessManager Event (Nr=1) Event (Nr=2) Event (Nr=3) Command EventHandler Router ProcessManagers
  11. EventHandler StreamProjector Data QueryModel Object Data QueryModel Object Data QueryModel

    Object Query StreamItem Aggregate Command Event (Nr=1) Event (Nr=2) Event (Nr=3) Data QueryModel Object EventHandler Projector Query Event (Nr=1) Event (Nr=2) Event (Nr=3) StreamProjectors
  12. Data QueryModel Object EventHandler Projector Event (Nr=1; Id=C) Event (Nr=1;

    Id=B) Event (Nr=1; Id=A) Query Event (Nr=1; Id=1) Event (Nr=1; Id=2) Event (Nr=2; Id=1) Data QueryModel Object Data QueryModel Object EventHandler Projector Data QueryModel Object Data QueryModel Object Query Cross-Projector-Joins
  13. Data QueryModel Object EventHandler Projector Event (Nr=1; Id=C) Event (Nr=1;

    Id=B) Event (Nr=1; Id=A) Query Event (Nr=1; Id=1) Event (Nr=1; Id=2) Event (Nr=2; Id=1) Data QueryModel Object EventHandler Projector Data QueryModel Object Query
  14. Data QueryModel Object StreamItem Aggregate EventHandler Projector Command Event (Nr=1)

    Event (Nr=2) Event (Nr=3) Query Push notifications from projectors
  15. Data QueryModel Object EventHandler Projector Event (Nr=1; Id=C) Event (Nr=1;

    Id=B) Event (Nr=1; Id=A) Query Data QueryModel Object EventHandler Projector Data QueryModel Object Query Timers & Projectors-on-projectors
  16. Data QueryModel Object StreamItem Aggregate EventHandler Projector Command Event (Nr=1)

    Event (Nr=2) Event (Nr=3) Query StreamItem ProcessManager Event (Nr=1) Event (Nr=2) Event (Nr=3) Command EventHandler Router Parallel & low-priority event processing
  17. [email protected] @michielovereem https://movereem.nl Low-code / Impact analysis / Upgrade process

    / Several specific patterns Person Entity Customer Role Order Agreement party Spending limit Address Organisation Entity Delivery BusinessAc tivity party Invoice BusinessAc tivity party Address Address Spending limit Spending limit Own Organisation Workarea workarea Spending limit