Integrating microservices and distributed systems is hard. In this talk I will present three challenges we observed in real-life projects and how to avoid them. 1. Communication is complex. With everything being distributed failures are normal so you need sophisticated failure handling. 2. Asynchronicity requires you to handle timeouts. This is not only about milliseconds--systems get much more resilient when you can wait for minutes or hours. 3. Distributed transactions cannot simply be delegated to protocols like XA. I will not only use slides but demonstrate concrete source code examples.
24. 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.
54. 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
60. Who has no problems
operating a message bus?
Dead messages | No context | Inaccesible payload | Hard to redeliver |
Home-grown message hospitals | …
70. has to implement
Timeout, Retry,
Compensation
has to offer
Compensation
has to implement
Idempotency
Client Service Provider
71. has to implement
Timeout, Retry,
Compensation
has to offer
Compensation
has to implement
Idempotency
Client Service ProviderDon‘t forget
about state
72. Event-driven example also available
InventoryPaymentOrder ShippingCheckout Monitor
https://github.com/berndruecker/flowing-retail/
Human
Tasks
H2 H2
77. # Be aware of complexity of distributed systems
# Know strategies and tools to handle it
e.g. Circuit breaker (Hystrix)
Workflow engine for stateful retry, waiting, timeout
and compensation (Camunda)