SlideShare a Scribd company logo
Moving beyond request-reply:
How smart APIs are different.
@berndruecker
Moving beyond request reply - designing smarter APIs
Some
Service
Some
Service
Some
Service
Some
Service
Some
Service
Some
Service
Some
Service
Failure will happen.
Accept it!
But keep it local!
Be resilient.
Photo by Tookapic, available under Creative Commons CC0 1.0 license.
„There was an error
while sending your
boarding pass“
Check-in
Web-UI
Me
Current situation
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation – the good part
Circuit
breaker
Moving beyond request reply - designing smarter APIs
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation – the bad part
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation – the bad part
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Current situation – the bad part
Stateful
Retry
Moving beyond request reply - designing smarter APIs
We are having some technical
difficulties and cannot present you
your boarding pass right away.
But we do actively retry ourselves, so
lean back, relax and we will send it
on time.
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Possible situation – much better!
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Possible situation – much better!
Stateful
Retry
Warning:
Contains Opinion
Berlin, Germany
http://berndruecker.io/
mail@berndruecker.io
@berndruecker
Bernd Ruecker
Co-founder and
Chief Technologist of
Camunda
Check-In
You can use a workflow engine (=durable state machine)!
Barcode
REST
Stateful
retry
Want to see code?
https://github.com/berndruecker/flowing-retail
has to implement
Retry
has to implement
Idempotency
Client Service Provider
Moving beyond request reply - designing smarter APIs
Moving beyond request reply - designing smarter APIs
Don‘t worry, it will happen safely –
even if you loose connection.
Feel free to reload this page any time!
Photo by pixabay, available under Creative Commons CC0 1.0 license.
Requirement: Idempotency of services!
Photo by pixabay, available under Creative Commons CC0 1.0 license.
Requirement: Idempotency of services!
Photo by Chr.Späth, available under Public Domain.
Make every service idempotent!
Credit
Card
Payment
Charge Credit Card
cardNumber
amount
Charge Credit Card
cardNumber
amount
transactionId
Not idempotent
Idempotent
charge
Generally: create Ids
as soon as possible
Distributed systems introduce complexity you have to tackle!
Credit
Card
Payment
REST
Distributed
systems
It is impossible to
differentiate certain
failure scenarios.
Independant of
communication style!
Service
Provider
Client
Distributed systems introduce complexity you have to tackle!
Credit
Card
Payment
REST
Distributed systems introduce complexity you have to tackle!
Credit
Card
Payment
REST
Cancel
charge
Being able to implement
long running services
is essential for smart APIs
(on a technical level)
@berndruecker
Example
Booking Payment
Retrieve
Payment
@berndruecker
Example
Booking Payment
Credit
Card
Retrieve
Payment
@berndruecker
Example
Booking Payment
Credit
Card
Retrieve
Payment
Rejected
@berndruecker
Example
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Rejected
@berndruecker
Example
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Rejected
@berndruecker
A few
smart god services
tell
anemic CRUD services
what to do
Sam Newmann
Payment
failed
Who is responsible to deal with problems?
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Payment
received
@berndruecker
Payment
failed
Long running services
Booking Payment
Credit
Card
Retrieve
Payment
Rejected
Payment
received
Smart endpoints are
potentially long-running
@berndruecker
Being able to implement
long running services
is essential for smart APIs
(on a business level)
@berndruecker
Long running services
require async communication
Synchronous communication
Synchronous communication
is the crystal meth of
distributed programming
Todd Montgomery and Martin Thompson
in “How did we end up here” at GOTO Chicago 2015
Check-in
Barcode
Generator
Web-UI
Me
Output
Mgmt
Asynchronous communication
You need to
monitor
timeouts
Workflow…
Workflow…
Being able to implement
long running services
makes it easy to get async
@berndruecker
Can your company
leverage your
hipster architecture?
Shutterstock
You need to
change business
processes and
customer
experience!
Example
@berndruecker
Example
Payment
Seat
ReservationBooking
Ticket
Generation
Example
@berndruecker
sync
Example
@berndruecker
Weaknesses
Payment
Seat
ReservationBooking
Ticket
Generation
REST
Weaknesses: Latency creep
Payment
Seat
ReservationBooking
Ticket
Generation
REST
300 ms
1150 + x ms
600 ms
250 ms
Weaknesses: Availabiliy erosion
Payment
Seat
ReservationBooking
Ticket
Generation
REST
99 % uptime
99 % uptime
99 % uptime
96 % uptime
And it is even hard to implement
Payment
Seat
ReservationBooking
Ticket
Generation
REST
And it is even hard to implement
Payment
Seat
ReservationBooking
Ticket
Generation
REST
Typical pattern
Payment
Seat
ReservationBooking
Ticket
Generation
REST
Simulate synchronicty by waiting
(callback or polling)
@berndruecker
happy
case
failure
case
Redesign your business process accordingly!
Or some interface
to poll for status
Sync in happy case
Async response
@berndruecker
Redesign your business process accordingly!
Your business processes need to be more reactive!
@berndruecker
https://www.reactivemanifesto.org/
Yeah!
Let‘s go reactive.
Phil Calcado at QCon NYC 2019
API
API
API
API
API
API
API
Microservices
External Services
Standard Software
„What the hell just happened?“
@berndruecker
Example:
order fulfillment via
dash button
Photo by 0xF2, available under Creative Commons BY-ND 2.0
license. https://www.flickr.com/photos/0xf2/29873149904/
@berndruecker
Three steps…
@berndruecker
(Micro-)services
Checkout
Payment
Inventory
Shipment
@berndruecker
Order
Placed
Payment
Received
Goods
Fetched
Notification
Checkout
Payment
Inventory
Shipment
Event-driven architecture
@berndruecker
Peer-to-peer event chains
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Goods
shipped
Goods
fetched
@berndruecker
Peer-to-peer event chains
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Goods
shipped
Goods
fetched
@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
Peer-to-peer event chains
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Goods
shipped
Goods
fetched
Fetch the goods
before the
payment
@berndruecker
Peer-to-peer event chains
Checkout
Payment
Inventory
Shipment
Fetch the goods
before the
payment
Goods
fetched
Order
placed
Payment
received
Goods
shipped
@berndruecker
What we wanted
Photo by Lijian Zhang, available under Creative Commons SA 2.0 License and P..19 / CC BY-SA 4.0
@berndruecker
Order
Extract the end-to-end responsibility
Checkout
Payment
Inventory
ShipmentPayment
received
Order
placed
Retrieve
payment
@berndruecker
Order
Events & Commands
Checkout
Payment
Inventory
ShipmentPayment
received
Order
placed
Retrieve
payment
@berndruecker
Event
Command
Fact,
happened in the past,
immutable
Intend,
Want s.th. to happen
Order
It is not about the protocol!
Checkout
Payment
Inventory
Shipment
Order
placed
Retrieve
payment
It can still be messaging!
@berndruecker
Order
It is about where to decide about the coupling!
Checkout
Payment
Inventory
Shipment
Order
placed
Retrieve
payment
Order decides
. to listen to the event
. to issue the command
@berndruecker
Extract Orchestration logic
Workflows live inside service boundaries
@berndruecker
Your ITarchitecture
Choreography
Orchestration
@berndruecker
Your services
or applications
Monolith Chaos
Choreography
Orchestration
@berndruecker
Process Monitoring
Your services
or applications
Your ITarchitecture
Process Monitoring
Monolith Chaos
Choreography
Orchestration
Your services
or applications
Balance choreography and orchestration
@berndruecker
. Distributed systems are complex. At-least-once, retries and
idempotency are here to stay. Embrace async!
. Long-running services make your life easier and your API
smarter.
. Change business processes and customer experience accordingly
. Use commands + events = balance choreography and
orchestration
Thank you!
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
Kafka Summit 2020: If an event is published to a topic and no one is around t...
PDF
Complex event flows in distributed systems (QCon London 2019)
PDF
Reactive Summit 2020 - How state helps you to stay reactive
PDF
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
PDF
Complex event flows in distributed systems
PDF
GOTOpia 2020 - Balancing Choreography and Orchestration
PDF
2019 - Lost in transaction
PDF
Serverless Days 2019 - Lost in transaction
Kafka Summit 2020: If an event is published to a topic and no one is around t...
Complex event flows in distributed systems (QCon London 2019)
Reactive Summit 2020 - How state helps you to stay reactive
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
Complex event flows in distributed systems
GOTOpia 2020 - Balancing Choreography and Orchestration
2019 - Lost in transaction
Serverless Days 2019 - Lost in transaction

What's hot (20)

PDF
Apache Kafka Meets Workflow Engines | Bernd Ruecker, Camunda
PDF
JCon 2021 - Loosely or lousily coupled
PDF
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
PDF
Automating Processes in Modern Architectures
PDF
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
PDF
QCon NYC 2019 - Workflow automation reinvented
PDF
Digitalization and Workflow Automation - Camunda Process Automation Forum
PDF
Process Automation Forum April 2021 - Practical Process Automation
PDF
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
PDF
AWS Community Summit London 2019 - Lost in transaction
PDF
Destination Automation: Automating Processes in Modern Hipster Architectures
PDF
Workflow automation with BPMN. Lessons learned.
PDF
Jfokus 2018: Lost in transaction - Strategies to deal with (in-)consistency ...
PDF
JAX 2019 - Workflow automation reinvented
PDF
Microservices with Camunda - Talk from Camunda Days 01/2018
PDF
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
PDF
DDD Europe 2019: Lost in transaction
PDF
OOP 2021 - Leverage the full potential of your hipster architecture
PDF
JFS 2021 - The Process Automation Map
PDF
Java User Group Erfurt 2018: Zeebe.io - Event-driven Microservice Orchestration
Apache Kafka Meets Workflow Engines | Bernd Ruecker, Camunda
JCon 2021 - Loosely or lousily coupled
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
Automating Processes in Modern Architectures
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
QCon NYC 2019 - Workflow automation reinvented
Digitalization and Workflow Automation - Camunda Process Automation Forum
Process Automation Forum April 2021 - Practical Process Automation
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
AWS Community Summit London 2019 - Lost in transaction
Destination Automation: Automating Processes in Modern Hipster Architectures
Workflow automation with BPMN. Lessons learned.
Jfokus 2018: Lost in transaction - Strategies to deal with (in-)consistency ...
JAX 2019 - Workflow automation reinvented
Microservices with Camunda - Talk from Camunda Days 01/2018
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
DDD Europe 2019: Lost in transaction
OOP 2021 - Leverage the full potential of your hipster architecture
JFS 2021 - The Process Automation Map
Java User Group Erfurt 2018: Zeebe.io - Event-driven Microservice Orchestration
Ad

Similar to Moving beyond request reply - designing smarter APIs (20)

PDF
JCon Live 2023 - Lice coding some integration problems
PDF
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
PDF
Camunda Con Live 2020 Keynote - Microservice Orchestration and Integration
PDF
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
PDF
GopherCon UK 2018 - Orchestration of microservices
PDF
MuCon London 2017: Break your event chains
PDF
O'Reilly SA NYC 2018: Complex event flows in distributed systems
PDF
JCon 2017: Let your microservices flow
PDF
QCon London: Mastering long-running processes in modern architectures
PDF
Camunda Day New York 2019: Workflow Automation in Microservices Architectures...
PDF
Complex Event Flows in Distributed Systems (Bernd Ruecker, Camunda) Kafka Sum...
PDF
Collaboration of (micro-)services
PDF
"Choreography. The microservices ballet", Mauro Servienti
PDF
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
PDF
JUG Frankfurt - Orchestration of microservices
PDF
November 2017: Collaboration of (micro-)services
PDF
Goto meetup Stockholm - Let your microservices flow
PDF
3 common pitfalls in microservice integration
PDF
DDD Belgium Meetup 2017: Events, flows and long running services
PDF
QCon London 2018: 3 common pitfalls in microservice integration and how to av...
JCon Live 2023 - Lice coding some integration problems
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
Camunda Con Live 2020 Keynote - Microservice Orchestration and Integration
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
GopherCon UK 2018 - Orchestration of microservices
MuCon London 2017: Break your event chains
O'Reilly SA NYC 2018: Complex event flows in distributed systems
JCon 2017: Let your microservices flow
QCon London: Mastering long-running processes in modern architectures
Camunda Day New York 2019: Workflow Automation in Microservices Architectures...
Complex Event Flows in Distributed Systems (Bernd Ruecker, Camunda) Kafka Sum...
Collaboration of (micro-)services
"Choreography. The microservices ballet", Mauro Servienti
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
JUG Frankfurt - Orchestration of microservices
November 2017: Collaboration of (micro-)services
Goto meetup Stockholm - Let your microservices flow
3 common pitfalls in microservice integration
DDD Belgium Meetup 2017: Events, flows and long running services
QCon London 2018: 3 common pitfalls in microservice integration and how to av...
Ad

More from Bernd Ruecker (15)

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
Kafka Summit 2021 - Apache Kafka meets workflow engines
PDF
Micronaut Webinar 2021 - Process Automation Introduction
PDF
Webinar "Communication Between Loosely Coupled Microservices"
PDF
CamundaCon 2020 Keynote - The Return of Process Automation
PDF
Camunda Meetup: Rethink Business Processes and User Experience to Leverage Th...
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...
Kafka Summit 2021 - Apache Kafka meets workflow engines
Micronaut Webinar 2021 - Process Automation Introduction
Webinar "Communication Between Loosely Coupled Microservices"
CamundaCon 2020 Keynote - The Return of Process Automation
Camunda Meetup: Rethink Business Processes and User Experience to Leverage Th...

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Modernizing your data center with Dell and AMD
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Advanced Soft Computing BINUS July 2025.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The AUB Centre for AI in Media Proposal.docx
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
madgavkar20181017ppt McKinsey Presentation.pdf
Modernizing your data center with Dell and AMD

Moving beyond request reply - designing smarter APIs