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

O'Reilly London 2017: Complex Event Flows in Di...

O'Reilly London 2017: Complex Event Flows in Distributed Systems

O'Reilly Architecture 2017, London, United Kingdom

Martin Schimak

October 16, 2017
Tweet

More Decks by Martin Schimak

Other Decks in Programming

Transcript

  1. Complex event flows in distributed systems O‘Reilly Software Architecture Conference

    16th of October 2017 [email protected] [email protected] With thoughts from http://flowing.io @berndruecker | @martinschimak
  2. Bernd Rücker Consultant & Dev. Advocate 10+ years workflow Co-founder

    Camunda http://bernd-ruecker.com/ Martin Schimak Consultant & Trainer 15+ years domain (de-)coding DDDesign, TDD/BDD, EDA http://plexiti.com/ http://flowing.io/
  3. Event-Driven Checkout Payment Inventory Shipping Bus Order Placed Does not

    know recipient Does not know sender Decentral data management Smart endpoints and dumb pipes Event: Fact that happened in the past, Immutable fact, 0..n recepients Order Placed Customer status changed Does know event type…
  4. Shipping Goods shipped End-to-end capabilities using event flows? Inventory Payment

    Checkout Order placed Payment received Goods fetched Please fetch the goods while waiting for payment Some customers can pay via invoice …
  5. Inventory Payment Shipping Checkout Bus Order Order Placed Retrieve Payment

    Order Placed Event: Fact, happened in the past, immutable, 0..n recepients Let‘s make our core capability transparent – as a dedicated service Command: Intent, 1 recipient.
  6. Commanding is important! Inventory Payment Shipping Checkout Bus Order Placed

    Event: Fact, happened in the past, immutable, 0..n recepients Retrieve Payment Command: Intent, 1 recipient. Fetch Goods Ship Goods Order Order Placed Retrieve Payment Does not know sender Just knows command type… Dangerous?
  7. A customer can update an expired credit card within two

    weeks before we cancel his order „
  8. Pass around state as „routing slip“ Persist state with Entity,

    Actor, … State machine How to implement? DIY DIY
  9. State machines solve some hard developer problems Monitoring & Operations

    Handling of time & timeouts Retry Visibility & Reporting Versioning Compensation Message correlation & deduplication Performance & scalability
  10. State machines solve some hard developer problems Monitoring & Operations

    Handling of time & timeouts Retry Visibility & Reporting Versioning Compensation Message correlation & deduplication Performance & scalability
  11. Bpmn.createProcess("order").executable() //... .sendTask().name("Retrieve payment").camundaClass(RetrievePayme .receiveTask().name("Payment received").message("PaymentReceive //... { "name": "retrieve_payment",

    "tasks": [ { "name": "Retrieve Payment", "taskReferenceName": "payment", "type": "SIMPLE", ... Do you prefer coded or graphical DSLs? * BPMN - ISO notation for modeling and executing long-running processes and flows
  12. Order Order Order Order Architecture Order Engine A Payment Engine

    B Monitoring Human Task Management Coarse grained central monitoring Fine grained monitoring & operations (per context) DevOps Tec Ops Biz Ops Central
  13. Code online: https://github.com/flowing Slides & Blog: https://bernd-ruecker.com https://plexiti.com With thoughts

    from http://flowing.io @berndruecker | @martinschimak https://www.infoq.com /articles/microservice- event-choreographies