SlideShare a Scribd company logo
1 of 53
Break your event chains
MuCon, November 6th 2017, London
mail@bernd-ruecker.com
martin.schimak@plexiti.com
With thoughts from http://flowing.io
@berndruecker | @martinschimak
Bernd Rücker
Consultant & Dev. Advocate
10+ years workflow
Co-founder Camunda
http://bernd-ruecker.com/
Martin Schimak
Developer & Trainer, 10+ years
(de-)coding domain knowledge
DDDesign, TDD/BDD, EDA
http://plexiti.com/
http://flowing.io/
3 common hypotheses we check today:
# Events decrease coupling
# Central control needs to be avoided
# Workflow engines are painful
Simplified example:
dash button
Photo by 0xF2, available under Creative Commons BY-ND 2.0
license. https://www.flickr.com/photos/0xf2/29873149904/
Three steps…
Who is involved?
Checkout
Payment
Inventory
Shipment
Basic idea of dedicated, autonomous (micro-) services
Checkout
Payment
Inventory
Shipment
Dedicated Application Processes
Dedicated Persistence Backends
Dedicated Development Teams
Events decrease coupling
Request/Response: temporally coupled services
Checkout
Payment
Inventory
Shipment
„The button blinks green
if we can ship the item
within 24 hours!“
Request Response
Events: temporal decoupling with read models
Checkout
Payment
Inventory
Shipment
„The button blinks green
if we can ship the item
within 24 hours!“
Events are facts about
what happened (in the past)
Good
Fetched
Good
Stored
Read
Model
Events: Extract cross-cutting aspects
Checkout
Payment
Inventory
Shipment
„Inform the customer about
steps he is interested in!“
Order
placed
Payment
received
Good
shipped
Notify me when …
Order placed
Payment received
Good fetched
Good shipped
Customer
Mailings
Good
fetched
Events can decrease coupling*
*e.g. decentral data-management, read models,
extract cross-cutting aspects
Events: peer-to-peer event choreographies
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Good
shipped
„When the button is pressed, an
order is placed - and fulfilled!“
Good
fetched
Events: peer-to-peer event choreographies
Fetch the
goods before
retrieving the
payment
Some
customers can
pay via invoice
…
Checkout
Payment
Inventory
Shipment
Good
fetched
Order
placed
Payment
received
Good
shipped
Extract the end-to-end responsibility
Order
Checkout
Payment
Inventory
Shipment
Order
placed
Retrieve
payment
Commands have an
intent about what needs
to happen in the future
Fetch the
goods before
retrieving the
payment
Some
customers can
pay via invoice
Payment
received
Retrieve
payment
Events can increase coupling*
*e.g. complex peer-to-peer event chains
Commands can decrease coupling*
*e.g. to avoid complex peer-to-peer event chains
Central control needs to be avoided
Checkout
Payment
Inventory
Shipment
Order
Order
placed
Payment
received
Good
fetched
Good
shipped
Smart ESB-like middleware
Checkout
Payment
Inventory
Shipment
Order
Dumb pipes
„Smart endpoints and
dumb pipes!”
Martin Fowler
The danger of god services
Checkout
Payment
Inventory
Shipment
Order
„A few smart god services tell
anemic CRUD services what to do!”
Sam Newman
„Central“ order service
as bad as
central ESB logic?
A god service is only created with bad API design
Checkout
Payment
Inventory
Shipment
Order
„Smart endpoints and
dumb pipes!”
Martin Fowler
Smart endpoints
take care of a
business capability
their client does not
need to understand.
Ask: who is responsible to deal with problems?
Order
Credit
Card
Retrieve
Payment
Expired
A single central client of dumb endpoints
becomes a god service. Better: we create
several decentral, smart endpoints.
„If the credit
card expired, the
customer gets
another chance
to provide new
card details!“
Ask: who is responsible to deal with problems?
Order
Credit
Card
„If the credit
card expired, the
customer gets
another chance
to provide new
card details!“
Expired
„Smart endpoints are
potentially long-running.”
Payment
Retrieve
Payment
Payment
received
„The client of a smart
endpoint remains lean.”
Be sceptical about central control!*
*e.g. centralized ESB-like components or
god services which heavily interact with dumb endpoints
But don‘t give up control!*
*e.g. miss to extract and control important
potentially long-running business capabilities
The problem is not to command
services!
The problem is bad API design.
Workflow engines are painful
Persist thing with
Entity, Actor, …
State machine or
workflow engine
DIY
Order
Credit
Card
Payment
Payment
received
How to
implement long-
running services?
State machines
or workflow
engines
CADENCE
Baker
Workflow engines solve some hard developer problems
Monitoring &
Operations
Handling of time &
timeouts
Retry
Visibility &
Reporting
Versioning
Compensation
Message correlation &
deduplication
Performance &
scalability
Distributed systems
Workflow engines solve some hard developer problems
Monitoring &
Operations
Handling of time &
timeouts
Retry
Visibility &
Reporting
Versioning
Compensation
Message correlation &
deduplication
Performance &
scalability
Workflow
and
BPM
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
Timeouts
Compensation*
Living documentation for long-running behaviour
Focus on long-running behaviour - requiring state
A visual HTML report for a specific test case
Workflows live inside service boundaries
Explicit flows help separate domain and infrastructure
Infrastructure
Aggregates,
Domain Events,
Domain Services,
etc …
+ the flow
Workflow
Engine
Payment
Application
Domain
Lightweight workflow engines are
great (and much better than DIY)*
*e.g. enabling potentially long-running services, solving hard
developer problems, can run decentralized
Workflow engines can do (service)
orchestration.*
Orchestration is not about synchronous
request/response!
*We are not talking about container orchestration
# Events decrease coupling: sometimes
read-models, no complex peer-to-peer event chains, don‘t forget commands
# Central control needs to be avoided: sometimes
no ESB, smart endpoints/dumb pipes, important capabilities need a home
# Workflow engines are painful: some of them
lightweight engines are easy to use and can run decentralized,
they solve hard developer problems, don‘t DIY
Need some code?
InventoryPaymentOrder ShippingCheckout Monitor
https://github.com/flowing/flowing-retail/
Human
Tasks
Thank you!
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
Images licensed from iStock
no attribution required
All icons licensed from Noun Project
no attribution required
Images licensed under Creative Commons license
Photo by 0xF2, available under
Creative Commons BY-ND 2.0 license.
https://www.flickr.com/photos/0xf2/2987
3149904/

More Related Content

What's hot

What's hot (20)

Using Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfileUsing Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfile
 
Why I quit Amazon and Build the Next-gen Streaming System
Why I quit Amazon and Build the Next-gen Streaming SystemWhy I quit Amazon and Build the Next-gen Streaming System
Why I quit Amazon and Build the Next-gen Streaming System
 
Flink Forward Berlin 2018: Stefan Richter - "Tuning Flink for Robustness and ...
Flink Forward Berlin 2018: Stefan Richter - "Tuning Flink for Robustness and ...Flink Forward Berlin 2018: Stefan Richter - "Tuning Flink for Robustness and ...
Flink Forward Berlin 2018: Stefan Richter - "Tuning Flink for Robustness and ...
 
VictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - PreviewVictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - Preview
 
Patch Management on Windows with Puppet
Patch Management on Windows with PuppetPatch Management on Windows with Puppet
Patch Management on Windows with Puppet
 
How to Build a ML Platform Efficiently Using Open-Source
How to Build a ML Platform Efficiently Using Open-SourceHow to Build a ML Platform Efficiently Using Open-Source
How to Build a ML Platform Efficiently Using Open-Source
 
Apache Kafka Security
Apache Kafka Security Apache Kafka Security
Apache Kafka Security
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
 
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about..."Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
 
Introduction to Structured Streaming
Introduction to Structured StreamingIntroduction to Structured Streaming
Introduction to Structured Streaming
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
 
Rds data lake @ Robinhood
Rds data lake @ Robinhood Rds data lake @ Robinhood
Rds data lake @ Robinhood
 
Hadoop and Financial Services
Hadoop and Financial ServicesHadoop and Financial Services
Hadoop and Financial Services
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Breaking the cyber kill chain!
Breaking the cyber kill chain!Breaking the cyber kill chain!
Breaking the cyber kill chain!
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!
 
Singularity: The Inner Workings of Securely Running User Containers on HPC Sy...
Singularity: The Inner Workings of Securely Running User Containers on HPC Sy...Singularity: The Inner Workings of Securely Running User Containers on HPC Sy...
Singularity: The Inner Workings of Securely Running User Containers on HPC Sy...
 
Apache Flink Worst Practices
Apache Flink Worst PracticesApache Flink Worst Practices
Apache Flink Worst Practices
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 
A Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalkA Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalk
 

Similar to MuCon London 2017: Break your event chains

Ecommerce(3)
Ecommerce(3)Ecommerce(3)
Ecommerce(3)
ecommerce
 

Similar to MuCon London 2017: Break your event chains (20)

O'Reilly SA: Complex event flows in distributed systems
O'Reilly SA: Complex event flows in distributed systemsO'Reilly SA: Complex event flows in distributed systems
O'Reilly SA: Complex event flows in distributed systems
 
DDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running servicesDDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running services
 
KanDDDinsky: Let your domain events flow
KanDDDinsky: Let your domain events flowKanDDDinsky: Let your domain events flow
KanDDDinsky: Let your domain events flow
 
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
 
O'Reilly SA NYC 2018: Complex event flows in distributed systems
O'Reilly SA NYC 2018: Complex event flows in distributed systemsO'Reilly SA NYC 2018: Complex event flows in distributed systems
O'Reilly SA NYC 2018: Complex event flows in distributed systems
 
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestrationCamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
 
Long running processes in DDD
Long running processes in DDDLong running processes in DDD
Long running processes in DDD
 
Complex event flows in distributed systems
Complex event flows in distributed systemsComplex event flows in distributed systems
Complex event flows in distributed systems
 
Transforming Financial Services with Event Streaming Data
Transforming Financial Services with Event Streaming DataTransforming Financial Services with Event Streaming Data
Transforming Financial Services with Event Streaming Data
 
Building Serverless EDA w_ AWS Lambda (1).pptx
Building Serverless EDA w_ AWS Lambda (1).pptxBuilding Serverless EDA w_ AWS Lambda (1).pptx
Building Serverless EDA w_ AWS Lambda (1).pptx
 
JAX 2017 talk: Orchestration of microservices
JAX 2017 talk: Orchestration of microservicesJAX 2017 talk: Orchestration of microservices
JAX 2017 talk: Orchestration of microservices
 
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
 
Workflow automation with BPMN. Lessons learned.
Workflow automation with BPMN. Lessons learned.Workflow automation with BPMN. Lessons learned.
Workflow automation with BPMN. Lessons learned.
 
Ecommerce(3)
Ecommerce(3)Ecommerce(3)
Ecommerce(3)
 
Event mesh api meetup AsyncAPI Singapore
Event mesh api meetup AsyncAPI SingaporeEvent mesh api meetup AsyncAPI Singapore
Event mesh api meetup AsyncAPI Singapore
 
Iwp Preso 9 25 09
Iwp Preso 9 25 09Iwp Preso 9 25 09
Iwp Preso 9 25 09
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
 
Goto meetup Stockholm - Let your microservices flow
Goto meetup Stockholm - Let your microservices flowGoto meetup Stockholm - Let your microservices flow
Goto meetup Stockholm - Let your microservices flow
 
JUG Amsterdam - Orchestration of microservices
JUG Amsterdam - Orchestration of microservicesJUG Amsterdam - Orchestration of microservices
JUG Amsterdam - Orchestration of microservices
 
SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices  SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices
 

More from Bernd Ruecker

More from Bernd Ruecker (20)

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
 
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
 
JFall - Process Oriented Integration
JFall - Process Oriented IntegrationJFall - Process Oriented Integration
JFall - Process Oriented Integration
 
JavaLand 2023 - Process Oriented Integration
JavaLand 2023 - Process Oriented IntegrationJavaLand 2023 - Process Oriented Integration
JavaLand 2023 - Process Oriented Integration
 
CraftConf: Surviving the hyperautomation low code bubbl
CraftConf: Surviving the hyperautomation low code bubblCraftConf: Surviving the hyperautomation low code bubbl
CraftConf: Surviving the hyperautomation low code bubbl
 
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
Mastering Data for Higher Business Impact - at Commerzbank Innovation SummitMastering Data for Higher Business Impact - at Commerzbank Innovation Summit
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
 
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubbleCamunda Chapter Hamburg - Surviving the hyperautomation low code bubble
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
 
Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...
 
CamundaCon 2022 Keynote: The Process Orchestration Journey
CamundaCon 2022 Keynote: The Process Orchestration JourneyCamundaCon 2022 Keynote: The Process Orchestration Journey
CamundaCon 2022 Keynote: The Process Orchestration Journey
 
JAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupledJAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupled
 
JFS 2021 - The Process Automation Map
JFS 2021 - The Process Automation MapJFS 2021 - The Process Automation Map
JFS 2021 - The Process Automation Map
 
JCon 2021 - Loosely or lousily coupled
JCon 2021 - Loosely or lousily coupledJCon 2021 - Loosely or lousily coupled
JCon 2021 - Loosely or lousily coupled
 
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
 
Kafka Summit 2021 - Apache Kafka meets workflow engines
Kafka Summit 2021 - Apache Kafka meets workflow enginesKafka Summit 2021 - Apache Kafka meets workflow engines
Kafka Summit 2021 - Apache Kafka meets workflow engines
 
Process Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process AutomationProcess Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process Automation
 
Micronaut Webinar 2021 - Process Automation Introduction
Micronaut Webinar 2021 - Process Automation IntroductionMicronaut Webinar 2021 - Process Automation Introduction
Micronaut Webinar 2021 - Process Automation Introduction
 
Webinar "Communication Between Loosely Coupled Microservices"
Webinar "Communication Between Loosely Coupled Microservices"Webinar "Communication Between Loosely Coupled Microservices"
Webinar "Communication Between Loosely Coupled Microservices"
 
Automating Processes in Modern Architectures
Automating Processes in Modern ArchitecturesAutomating Processes in Modern Architectures
Automating Processes in Modern Architectures
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

MuCon London 2017: Break your event chains

  • 1. Break your event chains MuCon, November 6th 2017, London mail@bernd-ruecker.com martin.schimak@plexiti.com 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 Developer & Trainer, 10+ years (de-)coding domain knowledge DDDesign, TDD/BDD, EDA http://plexiti.com/ http://flowing.io/
  • 3. 3 common hypotheses we check today: # Events decrease coupling # Central control needs to be avoided # Workflow engines are painful
  • 4.
  • 5. Simplified example: dash button Photo by 0xF2, available under Creative Commons BY-ND 2.0 license. https://www.flickr.com/photos/0xf2/29873149904/
  • 8. Basic idea of dedicated, autonomous (micro-) services Checkout Payment Inventory Shipment Dedicated Application Processes Dedicated Persistence Backends Dedicated Development Teams
  • 10. Request/Response: temporally coupled services Checkout Payment Inventory Shipment „The button blinks green if we can ship the item within 24 hours!“ Request Response
  • 11. Events: temporal decoupling with read models Checkout Payment Inventory Shipment „The button blinks green if we can ship the item within 24 hours!“ Events are facts about what happened (in the past) Good Fetched Good Stored Read Model
  • 12. Events: Extract cross-cutting aspects Checkout Payment Inventory Shipment „Inform the customer about steps he is interested in!“ Order placed Payment received Good shipped Notify me when … Order placed Payment received Good fetched Good shipped Customer Mailings Good fetched
  • 13. Events can decrease coupling* *e.g. decentral data-management, read models, extract cross-cutting aspects
  • 14. Events: peer-to-peer event choreographies Checkout Payment Inventory Shipment Order placed Payment received Good shipped „When the button is pressed, an order is placed - and fulfilled!“ Good fetched
  • 15. Events: peer-to-peer event choreographies Fetch the goods before retrieving the payment Some customers can pay via invoice … Checkout Payment Inventory Shipment Good fetched Order placed Payment received Good shipped
  • 16. Extract the end-to-end responsibility Order Checkout Payment Inventory Shipment Order placed Retrieve payment Commands have an intent about what needs to happen in the future Fetch the goods before retrieving the payment Some customers can pay via invoice Payment received Retrieve payment
  • 17. Events can increase coupling* *e.g. complex peer-to-peer event chains
  • 18. Commands can decrease coupling* *e.g. to avoid complex peer-to-peer event chains
  • 19. Central control needs to be avoided
  • 22. The danger of god services Checkout Payment Inventory Shipment Order „A few smart god services tell anemic CRUD services what to do!” Sam Newman „Central“ order service as bad as central ESB logic?
  • 23. A god service is only created with bad API design Checkout Payment Inventory Shipment Order „Smart endpoints and dumb pipes!” Martin Fowler Smart endpoints take care of a business capability their client does not need to understand.
  • 24. Ask: who is responsible to deal with problems? Order Credit Card Retrieve Payment Expired A single central client of dumb endpoints becomes a god service. Better: we create several decentral, smart endpoints. „If the credit card expired, the customer gets another chance to provide new card details!“
  • 25. Ask: who is responsible to deal with problems? Order Credit Card „If the credit card expired, the customer gets another chance to provide new card details!“ Expired „Smart endpoints are potentially long-running.” Payment Retrieve Payment Payment received „The client of a smart endpoint remains lean.”
  • 26. Be sceptical about central control!* *e.g. centralized ESB-like components or god services which heavily interact with dumb endpoints
  • 27. But don‘t give up control!* *e.g. miss to extract and control important potentially long-running business capabilities
  • 28. The problem is not to command services! The problem is bad API design.
  • 30. Persist thing with Entity, Actor, … State machine or workflow engine DIY Order Credit Card Payment Payment received How to implement long- running services?
  • 32. Workflow engines solve some hard developer problems Monitoring & Operations Handling of time & timeouts Retry Visibility & Reporting Versioning Compensation Message correlation & deduplication Performance & scalability
  • 34. Workflow engines solve some hard developer problems Monitoring & Operations Handling of time & timeouts Retry Visibility & Reporting Versioning Compensation Message correlation & deduplication Performance & scalability
  • 36.
  • 37.
  • 38. 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
  • 41. Living documentation for long-running behaviour
  • 42. Focus on long-running behaviour - requiring state
  • 43. A visual HTML report for a specific test case
  • 44. Workflows live inside service boundaries
  • 45. Explicit flows help separate domain and infrastructure Infrastructure Aggregates, Domain Events, Domain Services, etc … + the flow Workflow Engine Payment Application Domain
  • 46. Lightweight workflow engines are great (and much better than DIY)* *e.g. enabling potentially long-running services, solving hard developer problems, can run decentralized
  • 47. Workflow engines can do (service) orchestration.* Orchestration is not about synchronous request/response! *We are not talking about container orchestration
  • 48.
  • 49. # Events decrease coupling: sometimes read-models, no complex peer-to-peer event chains, don‘t forget commands # Central control needs to be avoided: sometimes no ESB, smart endpoints/dumb pipes, important capabilities need a home # Workflow engines are painful: some of them lightweight engines are easy to use and can run decentralized, they solve hard developer problems, don‘t DIY
  • 50. Need some code? InventoryPaymentOrder ShippingCheckout Monitor https://github.com/flowing/flowing-retail/ Human Tasks
  • 52. 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
  • 53. Images licensed from iStock no attribution required All icons licensed from Noun Project no attribution required Images licensed under Creative Commons license Photo by 0xF2, available under Creative Commons BY-ND 2.0 license. https://www.flickr.com/photos/0xf2/2987 3149904/