Slides from a talk held at WJAX Munic on 9th of November (and some other meetups later in November) about how to tackle collaboration of microservices.
Most of the talk was live coding, the respective code is here: https://github.com/flowing/flowing-retail.
1. (Micro-)service collaboration
WJAX, Munic, 08th of November 2017
mail@bernd-ruecker.com | @berndruecker
With thoughts from http://flowing.io
@berndruecker | @martinschimak
23. 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
29. In general, application developers simply do
not implement large scalable applications
assuming distributed transactions. When
they attempt to use distributed transactions,
the projects founder because the
performance costs and fragility make them
impractical. Natural selection kicks in…
32. Request/Response: temporally coupled services
Checkout
Payment
Inventory
Shipment
„The button blinks green
if we can ship the item
within 24 hours!“
Request Response
33. Events: temporal decoupling with read models
Checkout
Payment
Inventory
Shipment
„The button blinks green
if we can ship the item
within 24 hours!“
Events are facts about
what happened (in the past)
Good
Fetched
Good
Stored
Read
Model
35. Events: peer-to-peer event choreographies
Checkout
Payment
Inventory
Shipment
Order
placed
Payment
received
Good
shipped
„When the button is pressed, an
order is placed - and fulfilled!“
Good
fetched
36. Events: peer-to-peer event choreographies
Please fetch
the goods
before waiting
for payment
Some
customers can
pay via invoice
…
Checkout
Payment
Inventory
Shipment
Good
fetched
Order
placed
Payment
received
Good
shipped
38. Extract the end-to-end responsibility
Order
Checkout
Payment
Inventory
Shipment
Order
placed
Retrieve
payment
Commands have an
intent about what needs
to happen in the future
Please fetch
the goods
before waiting
for payment
Some
customers can
pay via invoice
Payment
received
Retrieve
payment
42. Wrap-up
# Understand complexity of distributed systems
Sync/async, request/response, event-driven
# Know strategies and tools to handle it
e.g.Circuit breaker (Hystrix)
State machine for visual flow, wait, timeout,
retry and compensation (Camunda, Zeebe)