SlideShare a Scribd company logo
1 of 28
Download to read offline
Loosely or Lousily Coupled?
Understanding Communication Patterns
in Micorservice Architectures
By Thomas Heinrichs
About your speaker
Thomas Heinrichs
Developer Advocate @ Camunda
Thomas.heinrichs@camunda.com
@hafflgav
Augsburg, Germany
What will you
learn in this
session?
How you can make Pizza in a scalable
fashion
How orchestration differs from
choreography
What types of coupling to avoid or manage
Let’s talk about food!
How does ordering a Pizza work?
Phone Call Email with feedback loop
Email
■ Synchronous
blocking
communication
■ Feedback loop
■ Temporal coupling
■ Asynchronous non-
blocking
communication
■ No temporal
coupling
■ No temporal
coupliong
■ Asynchronous
■ With feedback loop
Pizza
Place
You
Phone Call
Pizza
Place
You
E-Mail
Pizza Place
You
E-Mail
Confirmation E-Mail
“ ■ Feedback Loop
■ != Result
Pizza Place
You
E-Mail
Confirmation E-Mail
Pizza Delivery
Synchrounous blocking vs Scalable Pizza Making
Synchronous blocking Scalable
■ Little Kebap store with only one
person working
■ Reponsible for everything
■ Queues pile up easily
■ Separation of order, payment and
preparation
■ Mixture of synchronous and
asynchronous
Synchrounous blocking vs Scalable Pizza Making
8
Transitioning the example
to the delivery service
■ The task of pizza making is long
running
■ Synchronous blocking
communication would not be
feasible
■ Using a mixture of both enables
better scalability and a clear
communication to the customer
■ How is this coordinated?
PUT /order
Pizza
Place
You
Pizza Delivery
HTTP 202
Pizza
Place
You
PUT /order
HTTP 200
Pizza Delivery
How can we handle such a long running task?
9
A workflow engine
provides long
running capabilities
What does a workflow engine do?
10
Scheduler
■ Can wait
■ Can retry
■ Can escalate
■ Can compensate
Workflow Definitions
■ Provides Visibility
Durable State
■ Is stateful
■ Provides durable states
One process instance gets
started. It is persisted in the
workflow engine and „walks“
through the process model.
@PUT
retrievePayment() {
result = workflowEngine.
startProcessInstance('payment')
if (result.hasEnded())
return 'paymentSucceeded'
else
return 'paymentSucceeded'
}
Your code to provide a REST endpoint
Instance
Id
Process
Definition
Current
State
…
…-7454 payment „Charge
Credit Card“
…
…-4571 payment „Charge
Credit Card“
…
Process Instance Table
Durable state of
workflow engine
Your glue code to implement the REST call
@Task('chargeCreditCard')
chargeCreditCard() {
...
restClient.put(
'http://creditCards/charge/',
requestData)
}
Credit Card
Service
REST
“
12
■ But isn’t this Orchestration which
couples everything much tighter?
Let’s try to analyse this by
having a more detailed
look at it.
Command vs. event-based Communication
■ Command = Intent
■ Cannot be ignored
■ Independent of communication
channel
Command-based
■ Event = Fact
■ Sender cannot control what
happens
Event-based
Pizza
Place
You
I order this pizza
OK – got it
Pizza
Place
You
„Hey – I am hungry!“
„Pizza Salmon
is ready!“
I baked this pizza for Andrea.
Please package it immediately
and deliver it while it‘s hot!
“
15
Definition of an Event
■ Something happened in the past. It
is a fact. Sender does not know
who picks up the event.
“
16
Definition of a Command
■ Sender wants something to
happen. It has an intent. Recipient
does not know who issued the
command.
Choreography vs Orchestration
■ Sombody ordered a Pizza
■ Pizza is ready
Choreography
■ Getting a very specific command
which Pizza for whom to prepare
Orchestration
Command
Orchestrator
“ ■ Orchestration = command-driven
communication
■ Choreography = event-driven
communication
Switching examples to Order Fulfillment
This is an Event Chain!
Problem:
■ An event chain is invisible
■ Not explicit
■ Hard to figure our – especially
in bigger architectures
■ Changing the sequence of steps
is difficult!
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Goods
shipped
Goods
fetched
Switching examples to Order Fulfillment
This is an Event Chain!
Problem:
■ An event chain is invisible
■ Not explicit
■ Hard to figure out – especially
in bigger architectures
■ Changing the sequence of steps
is difficult!
There are a lot of ressources about
this problem. E.g. from QCon or
even Martin Fowler.
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Goods
shipped
Goods
fetched
Orchestration and Choreography
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Retrieve
Payment
Order
Fulfillment
Choreography and
orchestration – event and
commands can be mixed!
“ ■ The Collaboration Style is
independent from the
Communication Style
This is very often mixed up!
The collaboration style is independent of communication style!
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Retrieve
Payment
Order
Fulfillment
Asynchronous
non-blocking
Asynchronous
non-blocking
Synchronous
blocking
Choreography
Orchestration
How could such a mix of orchestration and
choreography look like?
Orchestration Orchestration
Choreography
“
25
Communication Options - Summary
Communication
Style
Synchronous
Blocking
Asynchronous
Non-Blocking
Collaboration
Style
Command-Driven Event-Driven
Example REST
Messaging
(Queues)
Messaging
(Topics)
Feedback Loop
HTTP
Response
Response
Message
-
Pizza Ordering
via
Phone Call E-Mail Twitter
“
26
Loosely or lousily coupled?
Type of coupling Description Example Recommendation
Implementation
Coupling
Service knows
internals of other
services
Joined database Avoid
Temporal Coupling Service depends on
availability of other
services
Synchronous blocking
communication
Reduce or manage
Deployment Coupling Multiple services can
only be deployed
together
Release train Typically avoid, but
depends
Domain Coupling Business capabilities
require multiple
services
Order fulfillment
requires payment,
inventory and shipping
Unavoidable unless
you change business
requirements or
service boundaries
Summary and Take-Aways
27
■ Know
■ communication styles (sync/async)
■ collaboration styles (command/event)
■ You can get rid of temporal coupling with asynchronous
communication
■ Make sure you or your team can handle it
■ You will need long running capabilities (you might need it anyway)
■ Synchronous communication + correct patterns might also be OK
■ Domain coupling does not go away!
Thanks for listening!
Thomas Heinrichs
Developer Advocate @ Camunda
Thomas.heinrichs@camunda.com
@hafflgav
GitHub Repository with an example:
https://github.com/berndruecker/flowing-retail/tree/master/kafka

More Related Content

Similar to Loosely or lousily coupled? Understanding communication patterns in modern architectures with Thomas Heinrichs | Kafka Summit London 2022

Chrysalis simplicity
Chrysalis simplicityChrysalis simplicity
Chrysalis simplicityRamco Systems
 
Session replay: Discover why customers struggle on your website
Session replay: Discover why customers struggle on your websiteSession replay: Discover why customers struggle on your website
Session replay: Discover why customers struggle on your websiteSalmon Limited
 
Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...Bernd Ruecker
 
JAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupledJAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupledBernd Ruecker
 
Events and microservices
Events and microservicesEvents and microservices
Events and microservicesSaul Caganoff
 
How to build value in your landscape and lawn care business
How to build value in your landscape and lawn care businessHow to build value in your landscape and lawn care business
How to build value in your landscape and lawn care businessChuck Bowen
 
Pragmatic Event Driven Microservices
Pragmatic Event Driven MicroservicesPragmatic Event Driven Microservices
Pragmatic Event Driven MicroservicesAllard Buijze
 
Reactive Summit 2020 - How state helps you to stay reactive
Reactive Summit 2020 - How state helps you to stay reactiveReactive Summit 2020 - How state helps you to stay reactive
Reactive Summit 2020 - How state helps you to stay reactiveBernd Ruecker
 
Streamlining the compliance process presentation at Reckon Group Conference
Streamlining the compliance process presentation at Reckon Group ConferenceStreamlining the compliance process presentation at Reckon Group Conference
Streamlining the compliance process presentation at Reckon Group ConferenceReckon
 
Freelancing: How not to Suck
Freelancing: How not to SuckFreelancing: How not to Suck
Freelancing: How not to Suckandywalters
 
Lean six sigma introduction
Lean six sigma   introductionLean six sigma   introduction
Lean six sigma introductionThe Apprentiice
 
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs RecursoEloGroup
 
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs Recurso
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs RecursoProcess Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs Recurso
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs RecursoEloGroup
 
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical Lessons
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical LessonsLanding Page Optimization: 6 Years of Testing Distilled Into 5 Critical Lessons
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical LessonsTaboola
 
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...camunda services GmbH
 

Similar to Loosely or lousily coupled? Understanding communication patterns in modern architectures with Thomas Heinrichs | Kafka Summit London 2022 (20)

Chrysalis simplicity
Chrysalis simplicityChrysalis simplicity
Chrysalis simplicity
 
Watch your communication
Watch your communicationWatch your communication
Watch your communication
 
Session replay: Discover why customers struggle on your website
Session replay: Discover why customers struggle on your websiteSession replay: Discover why customers struggle on your website
Session replay: Discover why customers struggle on your website
 
Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...Loosely or lousily coupled - Understanding communication patterns in microser...
Loosely or lousily coupled - Understanding communication patterns in microser...
 
JAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupledJAX 2022 - Loosely or lousily coupled
JAX 2022 - Loosely or lousily coupled
 
Events and microservices
Events and microservicesEvents and microservices
Events and microservices
 
How to build value in your landscape and lawn care business
How to build value in your landscape and lawn care businessHow to build value in your landscape and lawn care business
How to build value in your landscape and lawn care business
 
Pragmatic Event Driven Microservices
Pragmatic Event Driven MicroservicesPragmatic Event Driven Microservices
Pragmatic Event Driven Microservices
 
Reactive Summit 2020 - How state helps you to stay reactive
Reactive Summit 2020 - How state helps you to stay reactiveReactive Summit 2020 - How state helps you to stay reactive
Reactive Summit 2020 - How state helps you to stay reactive
 
Streamlining the compliance process presentation at Reckon Group Conference
Streamlining the compliance process presentation at Reckon Group ConferenceStreamlining the compliance process presentation at Reckon Group Conference
Streamlining the compliance process presentation at Reckon Group Conference
 
Freelancing: How not to Suck
Freelancing: How not to SuckFreelancing: How not to Suck
Freelancing: How not to Suck
 
Lean six sigma introduction
Lean six sigma   introductionLean six sigma   introduction
Lean six sigma introduction
 
Bloom plseminar-sp15
Bloom plseminar-sp15Bloom plseminar-sp15
Bloom plseminar-sp15
 
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso
[Process Day 2011] Alec Sharp – Making Process Real Engaging the CXOs Recurso
 
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs Recurso
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs RecursoProcess Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs Recurso
Process Day 2010 - Alec Sharp – Making Process Real Engaging the CXOs Recurso
 
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical Lessons
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical LessonsLanding Page Optimization: 6 Years of Testing Distilled Into 5 Critical Lessons
Landing Page Optimization: 6 Years of Testing Distilled Into 5 Critical Lessons
 
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
 
PEX Sydney Steve_Towers * BPM is Dead, Long Live CEM *
PEX Sydney Steve_Towers * BPM is Dead, Long Live CEM *PEX Sydney Steve_Towers * BPM is Dead, Long Live CEM *
PEX Sydney Steve_Towers * BPM is Dead, Long Live CEM *
 
Steve Towers PEX_Sydney_Why_BPM_fails
Steve Towers PEX_Sydney_Why_BPM_failsSteve Towers PEX_Sydney_Why_BPM_fails
Steve Towers PEX_Sydney_Why_BPM_fails
 
Flowchart
FlowchartFlowchart
Flowchart
 

More from HostedbyConfluent

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonHostedbyConfluent
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolHostedbyConfluent
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesHostedbyConfluent
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaHostedbyConfluent
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonHostedbyConfluent
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonHostedbyConfluent
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyHostedbyConfluent
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...HostedbyConfluent
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...HostedbyConfluent
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersHostedbyConfluent
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformHostedbyConfluent
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubHostedbyConfluent
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonHostedbyConfluent
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLHostedbyConfluent
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceHostedbyConfluent
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondHostedbyConfluent
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsHostedbyConfluent
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemHostedbyConfluent
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksHostedbyConfluent
 

More from HostedbyConfluent (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit London
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and Kafka
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit London
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit London
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And Why
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka Clusters
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy Pub
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit London
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSL
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and Beyond
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink Apps
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC Ecosystem
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local Disks
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Loosely or lousily coupled? Understanding communication patterns in modern architectures with Thomas Heinrichs | Kafka Summit London 2022

  • 1. Loosely or Lousily Coupled? Understanding Communication Patterns in Micorservice Architectures By Thomas Heinrichs
  • 2. About your speaker Thomas Heinrichs Developer Advocate @ Camunda Thomas.heinrichs@camunda.com @hafflgav Augsburg, Germany
  • 3. What will you learn in this session? How you can make Pizza in a scalable fashion How orchestration differs from choreography What types of coupling to avoid or manage
  • 5. How does ordering a Pizza work? Phone Call Email with feedback loop Email ■ Synchronous blocking communication ■ Feedback loop ■ Temporal coupling ■ Asynchronous non- blocking communication ■ No temporal coupling ■ No temporal coupliong ■ Asynchronous ■ With feedback loop Pizza Place You Phone Call Pizza Place You E-Mail Pizza Place You E-Mail Confirmation E-Mail
  • 6. “ ■ Feedback Loop ■ != Result Pizza Place You E-Mail Confirmation E-Mail Pizza Delivery
  • 7. Synchrounous blocking vs Scalable Pizza Making Synchronous blocking Scalable ■ Little Kebap store with only one person working ■ Reponsible for everything ■ Queues pile up easily ■ Separation of order, payment and preparation ■ Mixture of synchronous and asynchronous
  • 8. Synchrounous blocking vs Scalable Pizza Making 8 Transitioning the example to the delivery service ■ The task of pizza making is long running ■ Synchronous blocking communication would not be feasible ■ Using a mixture of both enables better scalability and a clear communication to the customer ■ How is this coordinated? PUT /order Pizza Place You Pizza Delivery HTTP 202 Pizza Place You PUT /order HTTP 200 Pizza Delivery
  • 9. How can we handle such a long running task? 9 A workflow engine provides long running capabilities
  • 10. What does a workflow engine do? 10 Scheduler ■ Can wait ■ Can retry ■ Can escalate ■ Can compensate Workflow Definitions ■ Provides Visibility Durable State ■ Is stateful ■ Provides durable states
  • 11. One process instance gets started. It is persisted in the workflow engine and „walks“ through the process model. @PUT retrievePayment() { result = workflowEngine. startProcessInstance('payment') if (result.hasEnded()) return 'paymentSucceeded' else return 'paymentSucceeded' } Your code to provide a REST endpoint Instance Id Process Definition Current State … …-7454 payment „Charge Credit Card“ … …-4571 payment „Charge Credit Card“ … Process Instance Table Durable state of workflow engine Your glue code to implement the REST call @Task('chargeCreditCard') chargeCreditCard() { ... restClient.put( 'http://creditCards/charge/', requestData) } Credit Card Service REST
  • 12. “ 12 ■ But isn’t this Orchestration which couples everything much tighter? Let’s try to analyse this by having a more detailed look at it.
  • 13. Command vs. event-based Communication ■ Command = Intent ■ Cannot be ignored ■ Independent of communication channel Command-based ■ Event = Fact ■ Sender cannot control what happens Event-based Pizza Place You I order this pizza OK – got it Pizza Place You „Hey – I am hungry!“
  • 14. „Pizza Salmon is ready!“ I baked this pizza for Andrea. Please package it immediately and deliver it while it‘s hot!
  • 15. “ 15 Definition of an Event ■ Something happened in the past. It is a fact. Sender does not know who picks up the event.
  • 16. “ 16 Definition of a Command ■ Sender wants something to happen. It has an intent. Recipient does not know who issued the command.
  • 17. Choreography vs Orchestration ■ Sombody ordered a Pizza ■ Pizza is ready Choreography ■ Getting a very specific command which Pizza for whom to prepare Orchestration Command Orchestrator
  • 18. “ ■ Orchestration = command-driven communication ■ Choreography = event-driven communication
  • 19. Switching examples to Order Fulfillment This is an Event Chain! Problem: ■ An event chain is invisible ■ Not explicit ■ Hard to figure our – especially in bigger architectures ■ Changing the sequence of steps is difficult! Checkout Payment Inventory Shipment Order placed Payment received Goods shipped Goods fetched
  • 20. Switching examples to Order Fulfillment This is an Event Chain! Problem: ■ An event chain is invisible ■ Not explicit ■ Hard to figure out – especially in bigger architectures ■ Changing the sequence of steps is difficult! There are a lot of ressources about this problem. E.g. from QCon or even Martin Fowler. Checkout Payment Inventory Shipment Order placed Payment received Goods shipped Goods fetched
  • 22. “ ■ The Collaboration Style is independent from the Communication Style This is very often mixed up!
  • 23. The collaboration style is independent of communication style! Checkout Payment Inventory Shipment Order placed Payment received Retrieve Payment Order Fulfillment Asynchronous non-blocking Asynchronous non-blocking Synchronous blocking Choreography Orchestration
  • 24. How could such a mix of orchestration and choreography look like? Orchestration Orchestration Choreography
  • 25. “ 25 Communication Options - Summary Communication Style Synchronous Blocking Asynchronous Non-Blocking Collaboration Style Command-Driven Event-Driven Example REST Messaging (Queues) Messaging (Topics) Feedback Loop HTTP Response Response Message - Pizza Ordering via Phone Call E-Mail Twitter
  • 26. “ 26 Loosely or lousily coupled? Type of coupling Description Example Recommendation Implementation Coupling Service knows internals of other services Joined database Avoid Temporal Coupling Service depends on availability of other services Synchronous blocking communication Reduce or manage Deployment Coupling Multiple services can only be deployed together Release train Typically avoid, but depends Domain Coupling Business capabilities require multiple services Order fulfillment requires payment, inventory and shipping Unavoidable unless you change business requirements or service boundaries
  • 27. Summary and Take-Aways 27 ■ Know ■ communication styles (sync/async) ■ collaboration styles (command/event) ■ You can get rid of temporal coupling with asynchronous communication ■ Make sure you or your team can handle it ■ You will need long running capabilities (you might need it anyway) ■ Synchronous communication + correct patterns might also be OK ■ Domain coupling does not go away!
  • 28. Thanks for listening! Thomas Heinrichs Developer Advocate @ Camunda Thomas.heinrichs@camunda.com @hafflgav GitHub Repository with an example: https://github.com/berndruecker/flowing-retail/tree/master/kafka