Distributed processes with an event-driven approach embrace the impossibility of the two-phase commit in distributed transactions. Instead of trying to make a big transaction across modules and databases, it does a sequence of microtransactions.
Each operation is handled by the module that’s the source of truth and can make autonomous decisions. The distributed process is triggered by the event registered and published in the system, e.g. shopping cart confirmed.
Then another module can subscribe to it and take it from there. It knows what should be the next operation, e.g. initiating the order process. It sends a handled command, and business logic creates another event. This event is the trigger for the next step of the workflow. Such lasagne of event/command/event/command continues until the process is finished (with success or failure).
We modelled a simple but representative distributed process during the webinar: a guest group checkout. We started with Miro and modelling and then discussed the implementation.
See the reference implementation in:
- C#,
- Java.
Read also more in:
- Saga and Process Manager - distributed processes in practice,
- Event-driven distributed processes by example.
Webinars:
#2 - Keep your streams short! Or how to model Event-Sourced systems efficiently
#3 - Implementing Distributed Processes
#6 - Alexey Zimarev - You don't need an Event Sourcing framework. Or do you?
#7 - Design and test Event-Driven projections and read models
#9 - Radek Maziarka - Modularization with Event Storming Process Level
#11 - Maciej "MJ" Jędrzejewski - Evolutionary Architecture: The What. The Why. The How.
#12 - Jeremy D. Miller: Simplify your architecture with Wolverine
#14 - Mateusz Jendza: Why Verified Credentials is the Future of Digital Identity!
#15 - Mário Bittencourt: Leveraging BPMN for Seamless Team Collaboration in Software Development
Papers We Love #1 - Sagas (Hector Garcia-Molina, Kenneth Salem)
Watch with a 7-day free trial
Subscribe to Architecture Weekly to watch this video and get 7 days of free access to the full post archives.