Slides from my talk at the GOTO meetup in Stockholm on 5th of April 2017. The talk is about the flow in microservices, so how a bunch of loosely coupled microservices can fulfill an overall business goal.
5. Microservices
• Independent components
• Independent deployments
• Decoupling between components
• Dedicated teams to fight conways law
• Autonomy of technology decisions
• Avoid horizontal team boundaries
• New DevOps paradigms
Microservice
Microservice
Microservice
Monolith
A
B
C
A
B
C
13. Sample microservices
Inventory service
Handles Stock,
Reserviations and
physical handling
of goods
Payment service Handles Payment
Shipping service
Manage
shipments &
labels for logistic
providers
21. Event Command Transformation
Payment Service
do
payment
order
placed Transformation
Command
Something has to happen
in the future
1 recipient
Event
Something has happend
in the past
0..n recipients
22. This calls for an order service
Payment service
do
payment
order
placed Order service
25. Smeels like a
central ESB?
http://apsblog.burtongroup.com/2009/01/soa-is-dead-long-live-services.html
26. No! Far from it!
Inventory service
Payment service
Order service
Not in the pipe
but in a domain
related service.
Probably
simple code.
Shipping service
56. Lightweight and embeddable engines
Engine must be
• easy to use
• developer friendly
also in the scope of multiple
scopes/aggregates/services
• technically
• license model
Payment
Order
engine
engine
…
…
…
…
engine
60. Martin Fowler
Event notification is nice because it implies a low level of
coupling, and is pretty simple to set up. It can become
problematic, however, if there really is a logical flow
that runs over various event notifications. The
problem is that it can be hard to see such a flow as it's
not explicit in any program text. Often the only way to
figure out this flow is from monitoring a live system.
This can make it hard to debug and modify such a flow.
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
68. Changes
Inventory service
Payment service
Order service
Shipping service
must provide
reservation
servicereserve goods at
right moment
Listen to goods
reserved instead
of order created.
Listen to order
created.
With event command
transformation
Without
71. Required changes
Inventory service
Payment service
Order service
Shipping service
Invoice service
skip payment, but
add open invoice
Listen to order
created VIP or
payment received
(non VIP).
Listen to order
created (VIP).
77. Summary
• Microservices and event driven
architecture go well together
• You need an event command
transformation
• If the translation is stateful,
consider using an appropriate
engine
• Modern lightweight engines
foster and not hinder these
architectures
78. Is it really for me?
Isn‘t all of that just for FANG?