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.

BASTA! Orchestration of microservices

1,308 views

Published on

Slides from my talk at the BastaCon (Germany's biggest .NET conference) on 28th of September 2017 about orchestration of microservices

Published in: Technology
  • Be the first to comment

BASTA! 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 Trip Booking Hotel Car Flight Payment
  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. The example in BPMN* * ISO Standard for modeling and execution
  11. 11. The example in BPMN*
  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. Living documentation
  16. 16. Executable with operational visibility
  17. 17. Historical data and analysis
  18. 18. Warum macht eigentlich so ein junges und dynamisches Unternehmen wie ihr so ein alte Männer Thema wie BPM? Ein nicht weiter genannter Chefredakteur „
  19. 19. BPM done right Developer friendly Flexible & composable BizDevOps Death by properties panel
  20. 20. Live hacking Using http://camunda.org as example
  21. 21. REST Tomcat Camunda Application / Service DB Datasource Webapps REST Sample architecture
  22. 22. Docker Image REST Tomcat Application / Service DB Datasource Camunda Webapps REST Sample architecture
  23. 23. Docker Image REST Tomcat Trip Booking Service (C#) DB Datasource Camunda Webapps REST Sample architecture
  24. 24. External tasks and task worker FetchAndLock Complete Handle BPMN Error Handle Failure Camunda Your application
  25. 25. Live hacking
  26. 26. Waiting requires state
  27. 27. More long running requirements
  28. 28. Payment example
  29. 29. Synchronous communication?
  30. 30. Asynchronous & reactive Trip Booking Hotel Car Flight Bus
  31. 31. Example Trip Booking Hotel Car Flight Bus Trip booked 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 Trip booked Customer status changed
  32. 32. 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… „
  33. 33. End-to-end capabilities using event flows? CarHotel FlightTrip booking Trip booked Hotel booked Car booked Flight booked
  34. 34. End-to-end capabilities using event flows? CarHotel FlightTrip booking Trip booked Hotel booked Car booked Flight booked Goods shipped Book the car first as we just negotiated better cancellation policies …
  35. 35. Commanding is equally important! CarHotel FlightTrip booking Bus Trip booked Event: Fact, happened in the past, immutable, 0..n recepients Book hotel Command: Intend, 1 recipient. Book car Book flight
  36. 36. Event command transformation CarHotel FlightTrip booking Bus Book hotel Book car Book flight Trip booked Book Hotel
  37. 37. Event command transformation CarHotel FlightTrip booking Bus Book hotel Book car Book flight Hotel booked Book car
  38. 38. Event command transformation CarHotel FlightTrip booking Bus Book hotel Book car Book flight Car booked Book flight
  39. 39. Event command transformation Car Book car Hotel booked Trip booking 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
  40. 40. The workflow implements event command transformations Trip booking
  41. 41. The workflow implements event command transformations Trip booking send command receive event
  42. 42. The workflow implements event command transformations Trip booking send command receive event Thin integration layer (e.g. Worker, Azure functions, …)
  43. 43. Distributed orchestration Trip booking Payment Engine Engine
  44. 44. 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
  45. 45. New kid on the block https://zeebe.io/ Zeebe Broker Your application Client
  46. 46. Thank you!
  47. 47. 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
  48. 48. 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

×