opportunities & pitfalls event-driven utopia€¦ · camunda. we build two different workflow...

85
Opportunities & Pitfalls of Event-Driven Utopia @berndruecker

Upload: others

Post on 01-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Opportunities & Pitfalls of Event-Driven Utopia

@berndruecker

Page 2: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Why this talk

Page 3: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Why this talk

Page 4: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 1

Agenda

Service 2

Events on the inside

Events on the outside

1

3

Page 5: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 1

Agenda

Service 2

Events on the inside

Events on the outside

1

3

Events inside out2

Page 6: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 1

Agenda

Service 2

Events on the inside1

Events on the outside3

Events inside out2

Page 7: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Once upon a time…

RDMS

Application

Client

BBC architecture(box - arrow – box – arrow - cylinder)

Every architecture diagramyou'll ever need

Page 8: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

The great thing about this architecture

RDMS

Application

DB gurantees (e.g. ACID)

Page 9: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

The problem

not webscaleresiliency is expensive

RDMS

Application

RDMS

cloud-scale

Page 10: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Pat Helland

https://vimeo.com/52831373

Page 11: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Append-onlyLog

bankaccount created

+2,500 $transfered

-14.99$paid by

credit card

Persistent change

RDMS

Account # Balance

12345 2,500$

Persistent state

Current Balance = 2,485.01 $

Page 12: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Append-onlyLog

bankaccount created

+2,500 $transfered

-14.99$paid by

credit card

Persistent change Event

Bank Account Created2019/04/16 11:00

# 12345

Event

Money Transfer Received2,500$

2019/04/16 11:00# 12345

Page 13: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

An example from my world

Page 14: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

[email protected]@berndruecker

Bernd RueckerCo-founder and Chief Technologist ofCamunda

Page 15: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

We build two different workflow engines. Why?

Camunda BPM ZeebePersistent State

Persistent change

Page 16: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

WorkflowInstanceId

CurrentActivity

State

2 RetrievePayment running

WorkflowInstanceId

CurrentActivity

State

2 ShipGoods running

WorkflowInstanceId

CurrentActivity

State

2 OrderDelivered ended

2.

3. UPDATE

2. UPDATE

1. INSERT

3.1.

RDMS

Workflow Engine

Page 17: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Append-onlyLog1.

createworkflowinstance

workflowinstancecreated

startevent

occured

sequenceflow taken

activityactivated

taskcreated

lockcreated

tasklocked

completetask

taskcompleted

activitycompleted

sequenceflow taken

2.

2.1.

Workflow Engine

Page 18: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Handling, Replication & Single Writer

FollowerFollower

complete taskcommand

task completedevent

1 send

2 append command

Broker (Leader)

StreamProcessor

4 process

7store & replicateevent6 append event

3store & replicatecommand

5 respond

Single Writer(single thread)

Page 19: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

What we do different

FollowerFollower

complete taskcommand

task completedevent

1 send

2 append command

Leader

StreamProcessor

4 process

7store & replicateevent6 append event

3store & replicatecommand

5 respond

Single Writer(single thread)

Store and replaycommands

Delete records thatare fully processed

Persist & replicateinternal state

Page 20: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

ConsistencyAvailabilityPartition

Page 21: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Zeebe is CP

FollowerFollower

complete taskcommand

task completedevent

1 send

2 append command

Leader

StreamProcessor

4 process

7store & replicateevent6 append event

3store & replicatecommand

5 respond

Single Writer(single thread)

Page 22: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Horizontal scalability by partitioning

Partition 1

Partition 2

Partition 3

Partition 4

Every workflow instance isexactly handled by onepartition

instance id: 2-42

instance id: 3-66

StreamProcessor Single Writer

(single thread)

Page 23: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Queries and read models

ZeebeBroker

ZeebeBroker

StreamingExporter

ask

ask

Page 24: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Recap 1 – Events on the inside

# Natural mechanism to build scalable services in distributed systems (with Outbox & co included)

But# You have to think about reads, queries & eventual consistency# Few industry experience available

@berndruecker

Page 25: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 1

Agenda

Service 2

Events on the inside

Events on the outside

1

3

Events inside out2

Page 26: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Store and Messaging

Customer

1. Create Customer

Customer Event Store

Page 27: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Merge Messaging and Event Store

Customer

1. Create Customer

Customer Event Store

Page 28: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Merge messaging and event store

Customer

1. Create Customer

Shared Event Store

Page 29: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Enter the world of Kafka…

Page 30: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Merge messaging and event store

Customer

1. Create Customer

Shared Event Store

Page 31: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Kafka as transport

Customer

1. Create Customer

Used as queue (but persistent!)

Page 32: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Kafka as transport

Customer

1. Create Customer

Used as queue (but persistent!)

Page 33: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 1

Agenda

Service 2

Events on the inside

Events on the outside

1

3

Events inside out2

Page 34: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Once upon a time

Billing

Customer

Change Address

Page 35: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Notification

Addresschanged

Billing

Customer

Page 36: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Notification

Addresschanged

Billing

Customer

Billing

Customer

Reverse directionof dependency

What‘sgeneral

WhichWho direction

of dependency

ChangeAddress

Page 37: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Notification

Addresschanged

Billing

Customer AdressChanged{

customerId: 42 }

Ask for details

Page 38: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event-carried State Transfer

Addresschanged

Billing

Customer

AddressChanged{ customerId: 42,address: ...

}

CustomerChanged{ customerId: 42,status: A,address:...,

}

AddressChanged{ customerId: 42,oldAddress: ...newAddress: ...

}

CustomerMoved{ ...,}

Page 39: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

This decision is complex

Addresschanged

Billing

Customer

Billing

Customer

Reverse directionof dependency

What‘sgeneral

WhichWho direction

of dependency

ChangeAddress

Page 40: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Example

Change Address

Address

SubmitFrom [email protected]

Date 2019-04-23 09.05

To confirm your address change please click on this link:

http://company.com/confirm?id=82e97d49-166c-4862-9973-4db348e6225d

Incoming Email

Page 41: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Example

Customer

Notification

Address changeconfirmed

Change AdressAddress change

requested

http://company.com/confirm?id=82e97d49-166c-4862-9973-4db348e6225d

direction of dependency

Page 42: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Example

Customer

Notification

‚Confirmation‘ approved

Change Adresshttp://company.com/confirm?id=82e97d49-166c-4862-9973-4db348e6225d

Send mail ‚Confirmation‘

Addresschanged

direction of dependency

Page 43: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Challenge:Command vs. Event

Event

Command

vs

Page 44: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

It is NOT about communication protocols

Addresschanged

Billing

Customer

Billing

Customer

ChangeAddress

It can be messaging, REST, whatever, ….

Page 45: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Manifold ways of transport

Page 46: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Manifold ways of transport

Page 47: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

?

Event Command Query

Message Record Event

Fact, happened in the past, immutable

Intend, Want s.th. to happen,The intention itself is a fact

Page 48: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

?

Event Command Query

Message Record Event

Page 49: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Commands in disguise

The Customer Needs To Be Sent A Message To Confirm

Address ChangeEvent

Send Message

Wording ofSender

Wording ofrecipient

Page 50: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Examples

PaymentOrder

Subscription

RetrievePayment

More general,does not need to know

who is retrieving paymentsCustomer

Order

AddressChanged

Billing

More general,does not need to care about

who is interessted in address changes

Notification

SendMail

Global service

OrderNotification

OrderPlaced

PaymentReceived

Goods Shipped

Service that canhandle notifications

for ordersautonomously

Page 51: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Distributed MonolithsAuthorization

Service

Document Context PageContext

Document attached

Pagecreated

Document moved

Page moved

Page 52: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Define stable contract/API insteadAuthorization

Service

Document Context PageContext

Add auth

Page 53: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Next challenge:Event chains

Page 54: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Chains

AdressCheck

Credit Check

Registration

@berndruecker

Customer

Event BusRegistration

requestedCredit

checkedAddresschecked

Customer registered

Page 55: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Event Chains

AdressCheck

Credit Check

Registration

@berndruecker

Customer

Event BusRegistration

requestedCredit

checkedAddresschecked

Customer registered

How does customerregistration work?

Page 56: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

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

@berndruecker

Page 57: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

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

@berndruecker

Page 58: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

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

@berndruecker

Page 59: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Monitoring Workflows Across Microservices

https://www.infoq.com/articles/monitor-workflow-collaborating-microservices

@berndruecker

Page 60: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Typical approachesDistributed Tracing

Data Lake / Event Monitoring

Process Mining

@berndruecker

Page 61: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

What we currently build with customers…

CamundaOptimize

ElasticRegistration

requestedCredit

checkedAddresschecked

Customer registered

@berndruecker

Page 62: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

All great – until you have to move…

Page 63: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Keep it stable, just move thatone stick down there to the

top.

How hardcan it be?

Page 64: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Changes required for an additional check

AdressCheck

Credit Check

Registration

CriminalCheck

@berndruecker

Customer

Event BusRegistration

requestedCredit

checkedCustomer registered

Addresschecked

Page 65: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Changes required for an additional check

AdressCheck

Credit Check

Registration

CriminalCheck

@berndruecker

Customer

Event BusRegistration

requestedCredit

checkedCustomer registered

Addresschecked

Criminalchecked

Page 66: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Alternative flow

AdressCheck

Credit Check

Registration

CriminalCheck

@berndruecker

Customer

Kafka Customer registered

Registration requested

Addresschecked

Creditchecked

Criminalchecked

Page 67: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Alternative flow

AdressCheck

Credit Check

Registration

CriminalCheck

@berndruecker

Customer

Kafka Customer registered

Registration requested

Addresschecked

Creditchecked

Criminalchecked

„Credit checks got moreexpensive, do that only if all

other checks succeed“

Page 69: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Orchestration

Address CheckCredit Check

Registration

Customer

KafkaRegistration

requestedCredit

checkedAddresschecked

Customer registeredCheck

credit

Check address

@berndruecker

Page 70: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Changes…

Address CheckCredit Check

Registration

Customer

KafkaRegistration

requestedCredit

checkedAddresschecked

Customer registeredCheck

credit

Check address

@berndruecker

Criminal Check

Crimes checked

Check crimes

Page 71: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Couplingmyths

@berndruecker

Page 72: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Comparison

2 changescriminal check can be deployed first

2 changes, criminal check can be deployed first

See also https://www.infoworld.com/article/3391592/how-to-tame-event-driven-microservices.html

@berndruecker

Page 73: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Your IT architecture

Choreography

Orchestration

@berndruecker

Your servicesor applications

Page 74: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Monolith Chaos

Choreography

Orchestration

@berndruecker

Process Monitoring

Your servicesor applications

Page 75: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Your IT architecture

Process Monitoring

Monolith Chaos

Choreography

Orchestration

Your servicesor applications

Balance choreography and orchestration@berndruecker

Page 76: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

In my world…

CustomerOn-boarding

Leverage Workflow Engine & BPMN within Service

Page 77: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Customer

Local Orchestration

CentralOrchestration

Service

Page 78: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Recap 2# Commands vs. Events: Decide about the direction ofdependencies# Beware of event-chains and avoid losing sight# Balance choreography and orchestration

@berndruecker

Page 79: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Service 2Service 1

Recap

Events on the inside

Events on the outside

1

3

Persistent state vs persistent changeEvent sourcing & Event StoreConsistency & CAPRead Models & CQRS

Events as APIEvent vs CommandEvent chains & visibilityOrchestration vs Choreography

Shared Event Store

Events inside out2

Page 80: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Want to see code?

Page 81: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Meet practicioners around orchestration & workflow April 23-24

Capital One,Cox Automotove, Nokia Bell Labs, Goldmann Sachs, …https://www.camundacon.com/

Page 82: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Nothing for the faint of heart…Events on the inside

Events on the outside

Page 83: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Nothing for the faint of heart…

…but doable…

…and worth it

Page 84: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

Thank you!

@berndruecker

Page 85: Opportunities & Pitfalls Event-Driven Utopia€¦ · Camunda. We build two different workflow engines. Why? Persistent Camunda BPM Zeebe State Persistent change. Workflow Instance

[email protected]@berndruecker

https://berndruecker.io

https://medium.com/berndruecker

https://github.com/berndruecker

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

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/