Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Orchestration of microservices
mail@bernd-ruecker.com
With thoughts from http://flowing.io
@berndruecker | @martinschimak
Software is
eating the
world.
Marc Andreessen,
Entrepreneur &
Investor
„
to pivot | pivoted, pivoted | [Tech]
If you are not
embarrassed
by the first
version of your
product, you’ve
launched too
late.
Reid Hoffman,
Co-Founder Linked...
Microservices: It is about speed and agility at scale
• Small components with
clear responsibilities
• Isolation
• Autonom...
Example
Checkout Payment Inventory Shipping
Distributed systems
Service A
Challenge: Synchronous collaboration
Call
service B
Service B
The network is unreliable
Circuit breaker & fail f...
Challenge: Distributed transactions
1. book
hotel
2. book
car
3. book
flight
6.
cancel
hotel
5.
cancel
car
4. In case of
f...
Example
* Modeled in BPMN
ISO Standard for modeling and execution
Example
Routing
slip
Persistent thing
(Entity, Actor, …)
State machine
How to
implement?
Implement yourself? *
* How hard can it be?
Routing
slip
Persistent thing
(Entity, Actor, …)
State machine
BPM done right
Developer friendly Composable BizDevOps
Death by
properties panel
Live hacking
Waiting requires state
More long running requirements possible
Synchronous communication?
Asynchronous & reactive
Checkout Payment Inventory Shipping
Bus
Example
Checkout Payment Inventory Shipping
Bus
Order
Placed
Does not
know
recepient
Does not
know
sender
Decentral data
m...
Misconceptions in the microservice community
*Picture randomly taken from http://wareflo.com/2016/11/from-apis-to-microser...
End-to-end capabilities using event flows?
InventoryPayment ShippingCheckout
Order
placed
Payment
received
Goods
fetched
G...
Shipping
Goods
shipped
End-to-end capabilities using event flows?
InventoryPaymentCheckout
Order
placed
Payment
received
G...
Commanding is equally important!
InventoryPayment ShippingCheckout
Bus
Order
Placed
Event: Fact,
happened in the past,
imm...
Event Command transformation
InventoryPayment ShippingCheckout
Bus
Order
Order
Placed
Retrieve
Payment
Event command transformation
Payment
Retrieve
Payment
Order
Placed Order
Command
Something has to happen
in the future
1 r...
Service A
Challenge: Asynchronous collaboration
Send
message
to B
Service B
Wait for
response
Timeout handling
Message cor...
Example
End-to-end processes cross microservice boundaries
Order
Inventory
Payment
Payment
Distributed flows are owned by microservices
Order
Distributed
orchestration
End-to-end process view
Order
Order
Order
Order
Architecture
Order
Engine A
Payment
Engine B
Monitoring
Human Task
Management
Coarse grained
centr...
Live hacking example
InventoryPaymentOrder ShippingCheckout Monitor
https://github.com/flowing/flowing-retail/
Live hacking
Container
(e.g. Tomcat, WildFly, Websphere, …)
Architecture possibilities
Your application
Engine
DB
BPMN Java …
Your appl...
New kid on the block
https://zeebe.io/
Zeebe
Broker
Your
application
Binary (MsgPack)
Support streaming & batching
Client
...
State machines solve some hard developer problems
Monitoring &
Operations
Handling of time &
timeouts
Retry
Visibility &
R...
Thank you!
Code:
https://github.com/berndruecker
Slides:
https://bernd-ruecker.com
Blog:
https://blog.bernd-ruecker.com
Feedback:
htt...
Images licensed from iStock
no attribution required
Images licensed under Creative Commons license
Photo by joi, available...
Upcoming SlideShare
Loading in …5
×

JUG Frankfurt - Orchestration of microservices

575 views

Published on

Slides from my talk held at JUG Frankfurt on 27th of September 2017 about microservice orchestration. Source code for the live hacking is here: https://github.com/flowing/flowing-retail

Published in: Technology
  • Be the first to comment

JUG Frankfurt - Orchestration of microservices

  1. 1. Orchestration of microservices mail@bernd-ruecker.com With thoughts from http://flowing.io @berndruecker | @martinschimak
  2. 2. Software is eating the world. Marc Andreessen, Entrepreneur & Investor „
  3. 3. to pivot | pivoted, pivoted | [Tech]
  4. 4. If you are not embarrassed by the first version of your product, you’ve launched too late. Reid Hoffman, Co-Founder LinkedIn (and others) „ Photo by joi, available under Creative Commons BY 2.0 license
  5. 5. Microservices: It is about speed and agility at scale • Small components with clear responsibilities • Isolation • Autonomy • Replaceability • Flexibility • Experimentation • Resilience • Individual scalability Photo by born1945, available under Creative Commons BY 2.0 license
  6. 6. Example Checkout Payment Inventory Shipping
  7. 7. Distributed systems
  8. 8. Service A Challenge: Synchronous collaboration Call service B Service B The network is unreliable Circuit breaker & fail fast Retry capability & async behavior
  9. 9. Challenge: Distributed transactions 1. book hotel 2. book car 3. book flight 6. cancel hotel 5. cancel car 4. In case of failure trigger compensations book trip Service A Car ServiceHotel Service Flight Service ACID-Transactions only local in the service contexts Distributed transaction via Saga pattern using compensating activities
  10. 10. Example * Modeled in BPMN ISO Standard for modeling and execution
  11. 11. Example
  12. 12. Routing slip Persistent thing (Entity, Actor, …) State machine How to implement?
  13. 13. Implement yourself? * * How hard can it be?
  14. 14. Routing slip Persistent thing (Entity, Actor, …) State machine
  15. 15. BPM done right Developer friendly Composable BizDevOps Death by properties panel
  16. 16. Live hacking
  17. 17. Waiting requires state
  18. 18. More long running requirements possible
  19. 19. Synchronous communication?
  20. 20. Asynchronous & reactive Checkout Payment Inventory Shipping Bus
  21. 21. Example Checkout Payment Inventory Shipping Bus Order Placed Does not know recepient Does not know sender Decentral data management Smart endpoints and dumb pipes Event: Fact that happened in the past, Immutable fact, 0..n recepients Order Placed Customer status changed
  22. 22. Misconceptions in the microservice community *Picture randomly taken from http://wareflo.com/2016/11/from-apis-to-microservices-workflow-orchestration-and-choreography-across-healthcare-organizations/. Not connected to statements on slide. Orchestration… …introduces single point of failure… …leads to god services… …leads to tight coupling… „
  23. 23. End-to-end capabilities using event flows? InventoryPayment ShippingCheckout Order placed Payment received Goods fetched Goods shipped
  24. 24. Shipping Goods shipped End-to-end capabilities using event flows? InventoryPaymentCheckout Order placed Payment received Goods fetched Please fetch the goods while waiting for payment Some customers can pay via invoice …
  25. 25. Commanding is equally important! InventoryPayment ShippingCheckout Bus Order Placed Event: Fact, happened in the past, immutable, 0..n recepients Retrieve Payment Command: Intend, 1 recipient. Fetch Goods Ship Goods
  26. 26. Event Command transformation InventoryPayment ShippingCheckout Bus Order Order Placed Retrieve Payment
  27. 27. Event command transformation Payment Retrieve Payment Order Placed Order Command Something has to happen in the future 1 recipient Event Something has happend in the past 0..n recipients Conciously decide where to do the coupling Transformation Customer Status Changed
  28. 28. Service A Challenge: Asynchronous collaboration Send message to B Service B Wait for response Timeout handling Message correlation & deduplication State handling Parallelism & merging
  29. 29. Example
  30. 30. End-to-end processes cross microservice boundaries Order Inventory Payment
  31. 31. Payment Distributed flows are owned by microservices Order Distributed orchestration
  32. 32. End-to-end process view
  33. 33. Order Order Order Order Architecture Order Engine A Payment Engine B Monitoring Human Task Management Coarse grained central monitoring Fine grained monitoring & operations (per context) DevOps Tec Ops Biz Ops Central
  34. 34. Live hacking example InventoryPaymentOrder ShippingCheckout Monitor https://github.com/flowing/flowing-retail/
  35. 35. Live hacking
  36. 36. Container (e.g. Tomcat, WildFly, Websphere, …) Architecture possibilities Your application Engine DB BPMN Java … Your application Engine DB BPMN Java … Engine (Docker, Tomcat, …) Your application DB Embedded engine Container managed engine Remote engine BPMN Java, C#, Go, JS, …
  37. 37. New kid on the block https://zeebe.io/ Zeebe Broker Your application Binary (MsgPack) Support streaming & batching Client Horiziontally scalable Append only log / event sourcing
  38. 38. State machines solve some hard developer problems Monitoring & Operations Handling of time & timeouts Retry Visibility & Reporting Versioning Compensation Message correlation & deduplication Performance & scalability
  39. 39. Thank you!
  40. 40. Code: https://github.com/berndruecker Slides: https://bernd-ruecker.com Blog: https://blog.bernd-ruecker.com Feedback: https://bernd-ruecker.com/feedback With thoughts from http://flowing.io @berndruecker | @martinschimak
  41. 41. Images licensed from iStock no attribution required Images licensed under Creative Commons license Photo by joi, available under Creative Commons BY 2.0 license. https://www.flickr.com/photos/joi/402948 7352/ Photo by techcrunch, available under Creative Commons BY 2.0 license. https://www.flickr.com/photos/techcrunc h/29035377473 Photo by born1945, available under Creative Commons BY 2.0 license. https://www.flickr.com/photos/12567713@N0 0/310639290 All icons licensed from Noun Project no attribution required

×