lost in transaction? · if your transaction involves 2 to 4 steps, choreography might be a very...
TRANSCRIPT
![Page 1: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/1.jpg)
@berndruecker
Lost in transaction?
Strategies to deal with(in)consistency in distributed systems
![Page 2: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/2.jpg)
Do A
Do B
All ornothing
+
try {tx.begin();doA();doB();tx.commit();} catch (Exception e) {tx.rollback();}
@Transactionalpublic void createCustomer(Customer cust) {// ...
}
Or simply:
Once upon a time:
![Page 3: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/3.jpg)
ACID
AtomicityConsistencyIsolationDurability
![Page 4: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/4.jpg)
Distributed systems
![Page 5: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/5.jpg)
Distributed systems
![Page 6: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/6.jpg)
Distributed systems
![Page 7: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/7.jpg)
But there is two-phase commit (XA)!!
TXCoordinator
ResourceManagers
PreparePhase
CommitPhase
![Page 8: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/8.jpg)
Pat Helland
“
Distributed Systems Guru Worked at Amazon, Microsoft & Salesforce
![Page 9: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/9.jpg)
Pat Helland
Grown-Ups Don’t Use Distributed Transactions
“
Distributed Systems Guru Worked at Amazon, Microsoft & Salesforce
![Page 10: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/10.jpg)
Starbucks does not use two phase commithttps://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.html
Photo by John Ingle
![Page 11: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/11.jpg)
Eric BrewerAtomicityConsistencyIsolationDurability
http://pld.cs.luc.edu/courses/353/spr11/notes/brewer_keynote.pdf
![Page 12: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/12.jpg)
That means
Do A
Do B
Temporarilyinconsistent
Eventuallyconsistentagain
t
Consistent
LocalACID
LocalACID
1 (micro-)service1 aggregate1 program1 resource
Violates „I“ of ACID
![Page 13: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/13.jpg)
You
mig
htkn
owth
isfr
om:
Do A
Do B
Temporarilyinconsistent
Eventuallyconsistentagain
t
Consistent
Photo by Gerhard51, available under Creative Commons CC0 1.0 license.
![Page 14: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/14.jpg)
„Building on Quicksand“ Paper
ACID2.0Pat Helland
![Page 15: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/15.jpg)
AssociativeCommutativeIdempotentDistributed2.0
(a + b) + c = a + (b + c)
a + b = b + a
f(x) = f( f(x) )
„Building on Quicksand“ Paper
Pat Helland
![Page 16: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/16.jpg)
Photo by pixabay, available under Creative Commons CC0 1.0 license.
![Page 17: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/17.jpg)
Requirement: Idempotency of services!
Photo by pixabay, available under Creative Commons CC0 1.0 license.
![Page 18: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/18.jpg)
Requirement: Idempotency of services!
Photo by Chr.Späth, available under Public Domain.
![Page 19: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/19.jpg)
Example
CreditCard
Paymentcharge
![Page 20: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/20.jpg)
Strategy: retry
CreditCard
Payment
Charge Credit CardcardNumber
amount
Charge Credit CardcardNumber
amounttransactionId
Not idempotent
Idempotent
has to be idempotent
charge
![Page 21: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/21.jpg)
Distributed
![Page 22: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/22.jpg)
It is impossible todifferentiate certain
failure scenarios:
Independant ofcommunication style!
Service Provider
Client
![Page 23: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/23.jpg)
Strategy: Cleanup
CreditCard
Paymentcharge
Make sure it isnot charged!
Cancel chargecardNumber
amounttransactionId
Raisepayment failed
![Page 24: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/24.jpg)
Some communication challengesrequire state.
![Page 25: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/25.jpg)
Strategy: Stateful retry
CreditCard
Paymentcharge
![Page 26: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/26.jpg)
Strategy: Stateful retry
CreditCard
Paymentcharge
Make sure it isnot charged!
![Page 27: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/27.jpg)
Warning:Contains Opinion
![Page 28: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/28.jpg)
Berlin, Germany
[email protected]@berndruecker
Bernd RueckerCo-founder and Chief Technologist ofCamunda
![Page 29: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/29.jpg)
Let‘s use a lightweight OSS workflow engine for this:
![Page 30: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/30.jpg)
Payment
Stateful retry
CreditCardREST
![Page 31: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/31.jpg)
Stateful retry & cleanup
CreditCard
PaymentREST
Cancel
charge
![Page 32: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/32.jpg)
Live hacking
https://github.com/flowing/flowing-retail/tree/master/rest
![Page 33: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/33.jpg)
Embedded Engine Example (Java)
https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
![Page 34: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/34.jpg)
Remote Engine Example (Polyglot)
https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
![Page 35: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/35.jpg)
A relatively common pattern
Service(e.g. Go)
Kafka / Rabbit
RDMS
1. Receive
4. Send additional events
2. Business Logic
3. Send response? ACK
![Page 36: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/36.jpg)
„Can this handle 15k requests per second?“
![Page 37: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/37.jpg)
„Yes.“
![Page 38: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/38.jpg)
![Page 39: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/39.jpg)
![Page 40: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/40.jpg)
https://blogs.msdn.microsoft.com/pathelland/2007/05/15/memories-guesses-and-apologies/
![Page 41: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/41.jpg)
Compensation – the classical example
Sagabookhotel
bookcar
bookflight
cancelhotel
cancelcar
1. 2. 3.
5.6.
In case of failuretrigger compensations
booktrip
![Page 42: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/42.jpg)
2 alterntive approaches: choreography & orchestration
![Page 43: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/43.jpg)
Event-driven choreography
Hotel
Flight
Car
Trip
Tripbooked
Flightbooked
Triprequested
Hotelbooked
Carbooked
Requesttrip
![Page 44: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/44.jpg)
Event-driven choreography
Hotel
Flight
Car
Trip
Tripfailed
Triprequested
Hotelbooked
Carbooked
Requesttrip
Flightfailed
Car canceled
Hotel canceled
Perform undo(cancel car booking)
Perform undo(cancel hotel)
![Page 45: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/45.jpg)
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 46: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/46.jpg)
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 47: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/47.jpg)
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 48: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/48.jpg)
Classical example
Sagabookhotel
bookcar
bookflight
cancelhotel
cancelcar
1. 2. 3.
5.6.
In case of failuretrigger compensations
booktrip
![Page 49: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/49.jpg)
If your transaction involves 2 to 4 steps, choreography might be a very good fit.
However, this approach can rapidly become confusing if you keep adding extra steps in your transaction as it is difficult to track which services listen to which events. Moreover, it also might add a cyclic dependency between services as they have to subscribe to one another’s events.
Denis RosaCouchbase
https://blog.couchbase.com/saga-pattern-implement-business-transactions-using-microservices-part/
![Page 50: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/50.jpg)
Microservice pioneers have become aware
![Page 51: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/51.jpg)
Implementing changes in the process
Hotel
Flight
Car
Trip
Tripfailed
Triprequested
Hotelbooked
Carbooked
Requesttrip
Flightfailed
Car canceled
Hotel canceled
We have a new basic agreementwith the car rental agency and can cancel for free within 1 hour
– do that first!
![Page 52: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/52.jpg)
Implementing changes in the process
Hotel
Flight
Car
Trip
Tripfailed
Triprequested
Hotelbooked
Carbooked
Requesttrip
Flightfailed
Car canceled
Hotel canceled
You have to adjust all services and redeploy at the same time!
We have a new basic agreementwith the car rental agency and can cancel for free within 1 hour
– do that first!
![Page 53: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/53.jpg)
Photo by born1945, available under Creative Commons BY 2.0 license.
![Page 54: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/54.jpg)
What we wanted
Photo by Lijian Zhang, available under Creative Commons SA 2.0 License and Pedobear19 / CC BY-SA 4.0
![Page 55: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/55.jpg)
Orchestration
Hotel
Flight
Car
Trip
Tripbooked
Requesttrip
Bookhotel
Hotelbooked
Carbooked
Flightbooked
Book car
Bookflight
![Page 56: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/56.jpg)
Orchestration
Hotel
Flight
Car
Trip
Tripbooked
Requesttrip
Bookhotel
Hotelbooked
Carbooked
Flightbooked
Book car
Bookflight
We have a new basic agreementwith the car rental agency and can cancel for free within 1 hour
– do that first!
You have to adjust one service and redeploy only this one!
![Page 57: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/57.jpg)
Describe orchestration with BPMN
Trip
Tripbooked
Requesttrip
![Page 58: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/58.jpg)
The workflow is part of the service
Trip
![Page 59: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/59.jpg)
The workflow is part of the service
Trip
Payment
![Page 60: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/60.jpg)
Caitie McCaffrey | @caitie
![Page 61: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/61.jpg)
Graphical models?
![Page 62: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/62.jpg)
Clemens VastersArchitect at Microsoft
http://vasters.com/archive/Sagas.html
![Page 63: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/63.jpg)
Clemens VastersArchitect at Microsoft
http://vasters.com/archive/Sagas.html
![Page 64: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/64.jpg)
Clemens VastersArchitect at Microsoft
http://vasters.com/archive/Sagas.html
![Page 65: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/65.jpg)
BPMNBusiness Process
Model and Notation
ISO Standard
![Page 66: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/66.jpg)
Living documentation for long-running behaviour
![Page 67: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/67.jpg)
Visual HTML reports for test cases
![Page 68: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/68.jpg)
BizDevOps
![Page 69: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/69.jpg)
Saga with AWS Step Functions
https://theburningmonk.com/2017/07/applying-the-saga-pattern-with-aws-lambda-and-step-functions/
![Page 70: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/70.jpg)
Thoughts on the state machine | workflow engine market
![Page 71: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/71.jpg)
Thoughts on the state machine | workflow engine market
OSS Workflow orOrchestration Engines
Stack Vendors,Pure Play BPMS
Low Code Platforms
Homegrown frameworksto scratch an itch
Integration Frameworks
Cloud Offerings
Uber, Netflix, AirBnb, ING, … AWS Step Functions, Azure Durable Functions, …
Camunda, Zeebe, jBPM, Activiti, Mistral, …
PEGA, IBM, SAG, …
Apache Airflow, Spring Data Flow, …
Apache Camel, Balerina, …
Data Pipelines
![Page 72: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/72.jpg)
Does it support stateful operations?
Does it support the necessary flow logic?
Does it support BizDevOps?
Does it scale?
![Page 73: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/73.jpg)
My personal pro-tip for a shortlist ;-)
OSS Workflow orOrchestration Engines
Stack Vendors,Pure Play BPMS
Low Code Platforms
Homegrown frameworksto scratch an itch
Integration Frameworks
Cloud Offerings
Data Pipelines
Camunda & Zeebe
![Page 74: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/74.jpg)
Recap
• Grown ups don‘t use distributed transactionsbut eventual consistency
• Idempotency is super important in distributed systems• Some consistency challenges require state• Know some strategies• Stateful retry & cleanup• Saga / Compensation• Apologies
![Page 75: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/75.jpg)
Thank you!
![Page 76: Lost in transaction? · If your transaction involves 2 to 4 steps, choreography might be a very good fit. However, this approach can rapidly become confusing if you keep adding extra](https://reader034.vdocuments.mx/reader034/viewer/2022050217/5f635ea130551637b2219145/html5/thumbnails/76.jpg)
[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/