SlideShare a Scribd company logo
@berndruecker
Coordination of Serverless
Functions
An example for today – the classical one
λ
Book Car
λ
Book
Hotel
λ
Book
Flight
@berndruecker
Function collaboration
λ
Book Car
λ
Book
Hotel
λ
Book
Flight
Book a
trip?
@berndruecker
Merged function
λ
(Trip)
// book har
$.post(carHireUrl,
...
// book hotel
$.post(carHireUrl,
...
Car.js
Hotel.js
Easy to do
No overhead
Big functions
Hard to maintain
No independent scaling
@berndruecker
Choreography
λ
(Car)
$.post(carHireUrl,
...
invokeHotel()
λ
(Hotel)
$.post(carHireUrl,
...
Chaining
λ
(Car)
$.post(carHireUrl,
...
carBookedEvent()
λ
(Hotel)
$.post(carHireUrl,
...
Event-Chain
No extra framework needed
Hard to understand the flow
Changing the sequence is hard
Orchestration / coordinator function
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
// book har
invokeCar()
// book hotel
invokeHotel()
@berndruecker
Distributed systems
Serverless London 2019 - Coordination of Serverless Functions
Orchestration / coordinator function
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
// book har
invokeCar()
// book hotel
invokeHotel()
@berndruecker
Orchestration / coordinator function
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
// book har
invokeCar()
// book hotel
invokeHotel()
@berndruecker
Orchestration / coordinator function
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
// book har
invokeCar()
// book hotel
invokeHotel()
Not idempotent
Idempotent
bookHotel(hotel, duration)
bookHotel(tripId,
hotel, duration)
@berndruecker
Photo by pixabay, available under Creative Commons CC0 1.0 license.
@berndruecker
Requirement: Idempotency of services!
Photo by pixabay, available under Creative Commons CC0 1.0 license.
@berndruecker
Requirement: Idempotency of services!
Photo by Chr.Späth, available under Public Domain.
@berndruecker
Distributed systems
@berndruecker
It is impossible to
differentiate certain
failure scenarios:
Independant of
communication style!
@berndruecker
Orchestration / coordinator function
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
// book har
invokeCar()
// book hotel
invokeHotel()
@berndruecker
// book hotel
try {
bookHotel()
} catch (err) {
cancelHotel()
}
Cleanup!
λ
(Trip)
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
PUT&
DELETE
// book har
invokeCar()
@berndruecker
Weaknesses
Car
HotelTrip
Flight
REST
@berndruecker
Weaknesses: Latency creep
Car
HotelTrip
Flight
REST
300 ms
1150 + x ms
600 ms
250 ms
@berndruecker
$$$
Weaknesses: Availabiliy erosion
Car
HotelTrip
Flight
REST
99 % uptime
99 % uptime
99 % uptime
96 % uptime
@berndruecker
Orchestration with workflow
λ
(Trip)
// book har
startTripWorkflow()
λ
(Car)
$.post(carHireUrl,
...
λ
(Hotel)
$.post(carHireUrl,
...
Workflow Engine
Car -> Hotel ->
...
@berndruecker
Warning:
Contains Opinion
Berlin, Germany
bernd.ruecker@camunda.com
@berndruecker
Bernd Ruecker
Co-founder and
Chief Technologist of
Camunda
Example
λ
(Car)
λ
(Hotel)
Workflow Engine
λ
(Flight)λ
(Trip)
Leverage retrying
λ
(Car)
λ
(Hotel)
Workflow Engine
λ
(Flight)λ
(Trip)
Leverage stateful retrying
λ
(Car)
λ
(Hotel)
Workflow Engine
λ
(Flight)λ
(Trip)
Let‘s talk about ACID All or nothing
Atomicity
Consistency
Isolation
Durability
Pat Helland
“
Distributed Systems Guru
Worked at Amazon,
Microsoft & Salesforce
@berndruecker
Pat Helland
Grown-Ups Don’t Use
Distributed Transactions
“
Distributed Systems Guru
Worked at Amazon,
Microsoft & Salesforce
@berndruecker
Eric Brewer
Atomicity
Consistency
Isolation
Durability
http://pld.cs.luc.edu/courses/353/spr11/notes/brewer_keynote.pdf @berndruecker
That means
Temporarily
inconsistent
Eventually
consistent
againt
Consistent
Local
ACID
Local
ACID
Violates „I“
of ACID
@berndruecker
λ
Book Car
λ
Book Hotel
@berndruecker
@berndruecker
Compensation – the classical example
Saga
book
hotel
book
car
book
flight
cancel
hotel
cancel
car
1. 2. 3.
5.6.
In case of failure
trigger compensations
book
trip
2 alterntive approaches: choreography & orchestration
@berndruecker
Event-driven choreography
Hotel
Flight
Car
Trip
Trip
booked
Flight
booked
Trip
requested
Hotel
booked
Car
booked
Request
trip
@berndruecker
Event-driven choreography
Hotel
Flight
Car
Trip
Trip
failed
Trip
requested
Hotel
booked
Car
booked
Request
trip
Flight
failed
Car
canceled
Hotel
canceled
Perform undo
(cancel car booking)
Perform undo
(cancel hotel)
@berndruecker
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
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
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
Implementing changes in the process
Hotel
Flight
Car
Trip
Trip
failed
Trip
requested
Hotel
booked
Car
booked
Request
trip
Flight
failed
Car
canceled
Hotel
canceled
We have a new basic agreement
with the car rental agency and
can cancel for free within 1 hour
– do that first!
@berndruecker
Implementing changes in the process
Hotel
Flight
Car
Trip
Trip
failed
Trip
requested
Hotel
booked
Car
booked
Request
trip
Flight
failed
Car
canceled
Hotel
canceled
You have to adjust all services and redeploy at the same time!
We have a new basic agreement
with the car rental agency and
can cancel for free within 1 hour
– do that first!
@berndruecker
What we wanted
Photo by Lijian Zhang, available under Creative Commons SA 2.0 License and CC BY-SA 4.0
@berndruecker
Orchestration
Hotel
Flight
Car
Trip
Trip
booked
Request
trip
Book
hotel
Hotel
booked
Car
booked
Flight
booked
Book
car
Book
flight
@berndruecker
Orchestration
Hotel
Flight
Car
Trip
Trip
booked
Request
trip
Book
hotel
Hotel
booked
Car
booked
Flight
booked
Book
car
Book
flight
We have a new basic agreement
with 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!
@berndruecker
Compensation
with workflow
Workflow Engine
λ
(Trip)
Saga Pattern
(implemented by BPMN
compensation)
Live hacking
https://github.com/berndruecker/trip-booking-saga-serverless
Workflow engine based on BPMN
Cloud-native
Source-available
Available as managed service
Demo architecture with Zeebe & Camunda Cloud
Camunda Cloud
Your cloud account
Zeebe Client
BPMN Workflow Definition
Trip Booking Function
Hotel Booking Function
…
Zeebe
API
Gateway
start
Invoke function
via HTTP
Deployed
onto Zeebe
Graphical models?
@berndruecker
Clemens Vasters
Architect at Microsoft
http://vasters.com/archive/Sagas.html
@berndruecker
Clemens Vasters
Architect at Microsoft
http://vasters.com/archive/Sagas.html
@berndruecker
Clemens Vasters
Architect at Microsoft
http://vasters.com/archive/Sagas.html
@berndruecker
Living documentation for long-running behaviour
@berndruecker
BizDevOps
@berndruecker
Step Functions
https://read.acloud.guru/how-the-saga-pattern-manages-failures-with-aws-lambda-and-
step-functions-bc8f7129f900
Think of more complicated scenarios…
Recap
• Function coordination might include orchestration and
workflow
• Carefully decide about choreography vs. orchestration
• Grown ups don‘t use distributed transactions
but eventual consistency
• Idempotency is super important!
• Know Saga / Compensation as strategy
Thank you!
@berndruecker
mail@berndruecker.io
@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/

More Related Content

PDF
AWS Community Summit London 2019 - Lost in transaction
PDF
OOP 2021 - Leverage the full potential of your hipster architecture
PDF
Kafka Summit 2021 - Apache Kafka meets workflow engines
PDF
Camunda Meetup: Rethink Business Processes and User Experience to Leverage Th...
PDF
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
PDF
JCon 2021 - Loosely or lousily coupled
PDF
Automating Processes in Modern Architectures
PDF
Destination Automation: Automating Processes in Modern Hipster Architectures
AWS Community Summit London 2019 - Lost in transaction
OOP 2021 - Leverage the full potential of your hipster architecture
Kafka Summit 2021 - Apache Kafka meets workflow engines
Camunda Meetup: Rethink Business Processes and User Experience to Leverage Th...
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
JCon 2021 - Loosely or lousily coupled
Automating Processes in Modern Architectures
Destination Automation: Automating Processes in Modern Hipster Architectures

What's hot (20)

PDF
The role of workflows in microservices
PDF
Apache Kafka Meets Workflow Engines | Bernd Ruecker, Camunda
PDF
Camunda Con Live 2020 Keynote - Microservice Orchestration and Integration
PDF
2019 - Lost in transaction
PDF
Serverless Days 2019 - Lost in transaction
PDF
QCon 2019 - Opportunities and Pitfalls of Event-Driven Utopia
PDF
Opportunities and Pitfalls of Event-Driven Utopia
PDF
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
PDF
Kafka Summit 2020: If an event is published to a topic and no one is around t...
PDF
Webinar "Communication Between Loosely Coupled Microservices"
PDF
Process Automation Forum April 2021 - Practical Process Automation
PDF
CamundaCon 2020 Keynote - The Return of Process Automation
PDF
Microservices with Camunda - Talk from Camunda Days 01/2018
PDF
2019 DACH Roadshow - Workflow Automation in Microservices Architectures
PDF
JFS 2021 - The Process Automation Map
PDF
QCon NYC 2019 - Workflow automation reinvented
PDF
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
PDF
Long running processes in DDD
PDF
CamundaCon 2018: The Role of Workflows in Microservices (Camunda)
PDF
7 sins of workflow
The role of workflows in microservices
Apache Kafka Meets Workflow Engines | Bernd Ruecker, Camunda
Camunda Con Live 2020 Keynote - Microservice Orchestration and Integration
2019 - Lost in transaction
Serverless Days 2019 - Lost in transaction
QCon 2019 - Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
Kafka Summit 2020: If an event is published to a topic and no one is around t...
Webinar "Communication Between Loosely Coupled Microservices"
Process Automation Forum April 2021 - Practical Process Automation
CamundaCon 2020 Keynote - The Return of Process Automation
Microservices with Camunda - Talk from Camunda Days 01/2018
2019 DACH Roadshow - Workflow Automation in Microservices Architectures
JFS 2021 - The Process Automation Map
QCon NYC 2019 - Workflow automation reinvented
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
Long running processes in DDD
CamundaCon 2018: The Role of Workflows in Microservices (Camunda)
7 sins of workflow
Ad

Similar to Serverless London 2019 - Coordination of Serverless Functions (20)

PDF
Bernd Rücker - Lost in transaction? Strategies to manage consistency in serve...
PDF
DDD Europe 2019: Lost in transaction
PDF
Reactive Summit 2020 - How state helps you to stay reactive
PDF
2020 06-03 cukenfest-bdd-and-sl_os
DOCX
chetan_ahire_resume
PPT
e-DMC: The web-based planning solution
PDF
sharfaheeknew
PDF
User Stories: Across the Seven Product Dimensions
PPTX
Uber Clone - Features, Admin Panel & Revenue Model.pptx
PDF
20140704 Fast and Furious Customer Journey Mapping Oracle Banks
PDF
On demand taxi service mobile app platform
PDF
Orchestrating Touchpoints - From Business to Buttons 2014
PDF
Chris Risdon - Orchestrating Touchpoints (From Business to Buttons 2014)
PDF
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
PDF
Solution Presentation - Fleet Management.pdf
PDF
Distributed sagas a protocol for coordinating microservices
PPTX
P I Infosoft Introduction And Travel Products
PDF
WordPress Web Development | ManekTech
PDF
Angularjs Web Application Development
PDF
Opensource Technology
Bernd Rücker - Lost in transaction? Strategies to manage consistency in serve...
DDD Europe 2019: Lost in transaction
Reactive Summit 2020 - How state helps you to stay reactive
2020 06-03 cukenfest-bdd-and-sl_os
chetan_ahire_resume
e-DMC: The web-based planning solution
sharfaheeknew
User Stories: Across the Seven Product Dimensions
Uber Clone - Features, Admin Panel & Revenue Model.pptx
20140704 Fast and Furious Customer Journey Mapping Oracle Banks
On demand taxi service mobile app platform
Orchestrating Touchpoints - From Business to Buttons 2014
Chris Risdon - Orchestrating Touchpoints (From Business to Buttons 2014)
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
Solution Presentation - Fleet Management.pdf
Distributed sagas a protocol for coordinating microservices
P I Infosoft Introduction And Travel Products
WordPress Web Development | ManekTech
Angularjs Web Application Development
Opensource Technology
Ad

More from Bernd Ruecker (17)

PDF
QCon London: Mastering long-running processes in modern architectures
PDF
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
PDF
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
PDF
JCon Live 2023 - Lice coding some integration problems
PDF
JFall - Process Oriented Integration
PDF
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
PDF
JavaLand 2023 - Process Oriented Integration
PDF
CraftConf: Surviving the hyperautomation low code bubbl
PDF
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
PDF
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
PDF
Loosely or lousily coupled - Understanding communication patterns in microser...
PDF
CamundaCon 2022 Keynote: The Process Orchestration Journey
PDF
JAX 2022 - Loosely or lousily coupled
PDF
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
PDF
Micronaut Webinar 2021 - Process Automation Introduction
PDF
GOTOpia 2020 - Balancing Choreography and Orchestration
PDF
Moving beyond request reply - designing smarter APIs
QCon London: Mastering long-running processes in modern architectures
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
JCon Live 2023 - Lice coding some integration problems
JFall - Process Oriented Integration
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
JavaLand 2023 - Process Oriented Integration
CraftConf: Surviving the hyperautomation low code bubbl
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
Loosely or lousily coupled - Understanding communication patterns in microser...
CamundaCon 2022 Keynote: The Process Orchestration Journey
JAX 2022 - Loosely or lousily coupled
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
Micronaut Webinar 2021 - Process Automation Introduction
GOTOpia 2020 - Balancing Choreography and Orchestration
Moving beyond request reply - designing smarter APIs

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf

Serverless London 2019 - Coordination of Serverless Functions