Complex event flows in distributed systems...Business IT Business processes automation Distributed...

92
Complex event flows in distributed systems @berndruecker With thoughts from http://flowing.io @berndruecker | @martinschimak

Transcript of Complex event flows in distributed systems...Business IT Business processes automation Distributed...

Page 1: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Complex event flows indistributed systems

@berndruecker With thoughts from http://flowing.io@berndruecker | @martinschimak

Page 2: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

3 common hypotheses I check today:

# Events decrease coupling# Orchestration needs to be avoided# Workflow engines are painful

Page 3: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Berlin, Germany

[email protected]@berndruecker

Bernd RueckerCo-founder and Developer Advocate ofCamunda

Page 4: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running
Page 5: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Simplified example:dash button

Photo by 0xF2, available under Creative Commons BY-ND 2.0 license. https://www.flickr.com/photos/0xf2/29873149904/

Page 6: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Three steps…

Page 7: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Who is involved? Some bounded contexts…

Checkout

Payment

Inventory

Shipment

Page 8: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

(Micro-)services

Checkout

Payment

Inventory

Shipment

Page 9: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Autonomous (micro-)services

Checkout

Payment

Inventory

Shipment

Dedicated Application Processes

Dedicated infrastructure

Dedicated Development Teams

Page 10: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Events decrease coupling

Page 11: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Example

Checkout

Payment

Inventory

Shipment

The button blinks if we canship within 24 hours

Page 12: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Request/response: temporal coupling

Checkout

Payment

Inventory

Shipment

RequestResponse

The button blinks if we canship within 24 hours

Page 13: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Temporal decoupling with events and read models

Checkout

Payment

Inventory

Shipment

GoodStored

Read Model

GoodFetched

The button blinks if we canship within 24 hours

*Events are facts about what happened (in the past)

Page 14: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Events can decrease coupling*

*e.g. decentral data-management, read models, extract cross-cutting aspects

Page 15: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Order placed

Payment received

Goodsshipped

Goodsfetched

Page 16: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Order placed

Payment received

Goodsshipped

Goodsfetched

Page 17: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

The danger is that it's very easy to make nicely decoupled systems with event notification, without realizing that you're losing sight of that larger-scale flow, and thus set yourself up for trouble in future years.

https://martinfowler.com/articles/201701-event-driven.html

Page 18: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

The danger is that it's very easy to make nicely decoupled systems with event notification, without realizing that you're losing sight of that larger-scale flow, and thus set yourself up for trouble in future years.

https://martinfowler.com/articles/201701-event-driven.html

Page 19: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

The danger is that it's very easy to make nicely decoupled systems with event notification, without realizing that you're losing sight of that larger-scale flow, and thus set yourself up for trouble in future years.

https://martinfowler.com/articles/201701-event-driven.html

Page 20: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Order placed

Payment received

Goodsshipped

Goodsfetched

Fetch the goodsbefore thepayment

Page 21: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Order placed

Payment received

Goodsshipped

Goodsfetched

Fetch the goodsbefore thepayment

Customers canpay via invoice

Page 22: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Order placed

Payment received

Goodsshipped

Goodsfetched

Fetch the goodsbefore thepayment

Page 23: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Peer-to-peer event chains

Checkout

Payment

Inventory

Shipment

Fetch the goodsbefore thepayment

Goodsfetched

Order placed

Payment received

Goodsshipped

Page 24: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Photo by born1945, available under Creative Commons BY 2.0 license.

Page 25: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Order

Extract the end-to-end responsibility

Checkout

Payment

Inventory

Shipment

*Commands have an intent about what needs to happen in the future

Order placed

Paymentreceived

Retrievepayment

Page 26: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Commands help to avoid (complex)peer-to-peer event chains

Page 27: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Orchestration needs to be avoided

Page 28: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Smart ESB-like middleware

Checkout

Payment

Inventory

Shipment

Order

Order placed

Payment received

Goodfetched

Goodshipped

Page 29: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Dumb pipes

Checkout

Payment

Inventory

Shipment

Order

Smart endpoints and dumb pipes

Martin Fowler

Page 30: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Danger of god services?

Checkout

Order

A fewsmart god services tellanemic CRUD services what to do

Sam Newmann

Payment

Inventory

Shipment

Page 31: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Danger of god services?

Checkout

Payment

Inventory

Shipment

Order

A fewsmart god services tellanemic CRUD services what to do

Sam Newmann

Page 32: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

A god service is only createdby bad API design!

Page 33: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Example

Order Payment

RetrievePayment

Page 34: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Example

Order PaymentCreditCard

RetrievePayment

Page 35: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Example

Order PaymentCreditCard

RetrievePayment

Rejected

Page 36: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Example

Order Payment

Client of dumb endpoints easily become a god services.

If the creditcard was

rejected, thecustomer canprovide new

details

CreditCard

RetrievePayment

RejectedRejected

Page 37: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Paymentfailed

Who is responsible to deal with problems?

Order Payment

If the credit card was

rejected, the customer can provide new

details

CreditCard

RetrievePayment

Rejected

Paymentreceived

Page 38: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Paymentfailed

Long-running execution

Order Payment

Clients of smart endpoints remains lean.

If the credit card was

rejected, the customer can provide new

details

CreditCard

RetrievePayment

Rejected

Paymentreceived

Smart endpoints are potentially long-running

Page 39: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Persist thing(Entity, Document, Actor, …)

State machine orworkflow engine

Typicalconcerns

DIY = effort, accidentalcomplexity

Scheduling, Versioning, operating, visibility, scalability, …

Handling State

Page 40: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Workflow engines are painful

Complex, proprietary, heavyweight, central, developer adverse, …

Page 41: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Avoid the wrong tools!

Death by properties panel

Low-code is great!(You can get rid

of your developers!)

Complex, proprietary, heavyweight, central, developer adverse, …

Page 42: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Workflow engines, state machines

It is

relevantin modern

architectures

Page 43: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

CADENCE

Silicon valleyhas recognized

Workflow engines, state machines

Page 44: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running
Page 45: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

CADENCEWorkflow engines, state machines

Page 46: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

CADENCE

also at scaleWorkflow engines, state machines

Page 47: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Zeebe.io

Page 48: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") //.startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

What do I mean by„leightweight?“

Page 49: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") //.startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

Build enginein one line ofcode(using in-memory H2)

Page 50: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") .startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

Define flowe.g. in Java DSL

Page 51: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") .startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

Define flowe.g. in Java DSL

Page 52: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

BPMNBusiness Process

Model and Notation

ISO Standard

Page 53: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") .startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

We can attachcode…

Page 54: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") .startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

…that iscalled whenworkflowinstances pass through

Page 55: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

public static void main(String[] args) { ProcessEngine engine = new StandaloneInMemProcessEngineConfiguration().buildProcessEngine();

engine.getRepositoryService().createDeployment() //.addModelInstance("flow.bpmn", Bpmn.createExecutableProcess("flow") .startEvent().serviceTask("Step1").camundaClass(SysoutDelegate.class).serviceTask("Step2").camundaClass(SysoutDelegate.class).endEvent()

.done()).deploy();

engine.getRuntimeService().startProcessInstanceByKey("flow", Variables.putValue("city", "New York"));

}public class SysoutDelegate implements JavaDelegate {public void execute(DelegateExecution execution) throws Exception {System.out.println("Hello " + execution.getVariable("city"));

}}

Start instances

Page 56: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Payment

Now you have a state machine!

Page 57: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Payment

Easy to handle time

Page 59: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Synchronous communication

RESTOrder Payment

CreditCard

Page 60: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Synchronous communication

RESTOrder Payment

CreditCard

Page 61: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Synchronous communication

REST

Order PaymentCreditCard

Page 62: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Synchronous communication

RESTOrder Payment

CreditCard

StatefulRetry

Page 63: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Distributedsystems

Page 64: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

It is impossible todifferentiate certain

failure scenarios.

Independant ofcommunication style!

Service Provider

Client

Page 65: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Distributed systems introduce complexity you have to tackle!

CreditCard

PaymentREST

Page 66: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Distributed systems introduce complexity you have to tackle!

CreditCard

PaymentREST

Page 67: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Distributedsystems

Page 68: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Distributed transactions using compensation *

Compensation

Page 69: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Relaxed consistency

Temporarily inconsistent

state

But eventually consistent

No Isolation (as in ACID)

Page 70: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

https://thenewstack.io/5-workflow-automation-use-cases-you-might-not-have-considered/

Page 71: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

<= milliseconds seconds minutes, weeks, …

Business

IT

Business processesautomation

Distributed Transactions

Orchestration

Communication in distributed systems

long runningalways short running short running, but potentially long running

Use cases for workflow automation

Page 72: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Biz Devimprove

communicationimprove

communication

Ops

Page 73: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Biz Dev

Leveragestate machine & workflow engine

Living documentation

Visibility in testing

improvecommunication

improvecommunication

Ops

Page 74: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Visual HTML reports for test cases

Page 75: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Biz Dev

Leveragestate machine & workflow engine

Living documentation

Visibility in testing

Understand and discussbusiness processes

Evaluate optimizationsin-sync with

implementation

improvecommunication

improvecommunication

Ops

Page 76: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Living documentation for long-running behaviour

Page 77: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Biz Dev

Leveragestate machine & workflow engine

Living documentation

Visibility in testing

Understand and discussbusiness processes

Evaluate optimizationsin-sync with

implementation

improvecommunication

improvecommunication

Ops

Page 78: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Biz Dev

Leveragestate machine & workflow engine

Living documentation

Visibility in testing

Operate with visibilityand context

Understand and discussbusiness processes

Evaluate optimizationsin-sync with

implementation

improvecommunication

improvecommunication

Ops

Page 79: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

ProperOperations

Visibility + Context

Page 80: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Before mapping processes explicitly with BPMN, the truth was buried in the code and nobody knew what was going on.

Jimmy Floyd, 24 Hour Fitnesse

Page 81: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Workflows live inside service boundaries

Page 82: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Manigfold architecture options

https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

Page 83: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Manigfold architecture options

https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

Page 84: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Manigfold architecture options

https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

Page 85: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Manigfold architecture options

https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

Page 86: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Manigfold architecture options

https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

Page 87: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Lightweight workflow engines aregreat* – don‘t DIY

*e.g. enabling potentially long-running services, solving harddeveloper problems, can run decentralized

Page 88: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Sales-Order & Order-Fulfillment

via Camunda

for every order worldwide

(Q2 2017: 22,2 Mio)

Page 89: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Code example & live demo

InventoryPaymentOrder ShippingCheckout Monitor

https://github.com/flowing/flowing-retail/

Human Tasks

H2 H2

Page 90: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

# Events decrease coupling: sometimesread-models, but no complex peer-to-peer event chains!

# Orchestration needs to be avoided: sometimesno ESB, smart endpoints/dumb pipes, important capabilities need a home

# Workflow engines are painful: some of themlightweight engines are easy to use and can run decentralized,they solve hard developer problems, don‘t DIY

Page 91: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

Thank you!

Page 92: Complex event flows in distributed systems...Business IT Business processes automation Distributed Transactions Orchestration Communication in distributed systems always short running

[email protected]@berndruecker

https://bernd-ruecker.com

https://blog.bernd-ruecker.com

https://github.com/flowing

https://www.infoq.com/articles/events-workflow-automation

With thoughts from http://flowing.io@berndruecker | @martinschimak

Contact:

Slides:

Blog:

Code:

https://www.infoworld.com/article/3254777/application-development/3-common-pitfalls-of-microservices-integrationand-how-to-avoid-them.html

https://thenewstack.io/5-workflow-automation-use-cases-you-might-not-have-considered/