microservice integration and
play

Microservice Integration and How to Avoid Them @berndruecker Bernd - PowerPoint PPT Presentation

3 Common Pitfalls in Microservice Integration and How to Avoid Them @berndruecker Bernd Ruecker Co-founder and Developer Advocate of Camunda Berlin, Germany bernd.ruecker@camunda.com @berndruecker REST, SOAP, Cloud, Saas, Microservices,


  1. 3 Common Pitfalls in Microservice Integration and How to Avoid Them @berndruecker

  2. Bernd Ruecker Co-founder and Developer Advocate of Camunda Berlin, Germany bernd.ruecker@camunda.com @berndruecker

  3. REST, SOAP, Cloud, Saas, Microservices, SCS, FaaS, Serverless, …

  4. Distributed systems

  5. https://www.infoworld.com/article/3254777/application-development/ 3-common-pitfalls-of-microservices-integrationand-how-to-avoid-them.html

  6. Distributed systems Communication Challenges of Distributed is complex asynchronicity T ransactions

  7. Some Service Some Some Service Service Some Service But keep it local! Some Service Failure will happen. Be resilient. Accept it! Some Some Service Service

  8. Let‘s start with a simple example Credit Payment Card REST

  9. Live hacking https://github.com/berndruecker/flowing-retail

  10. Circuit Breaker Photo by CITYEDV, available under Creative Commons CC0 1.0 license.

  11. Fai ail f l fast is important

  12. Fai ail f l fast is important but not enough!

  13. Photo by Tookapic, available under Creative Commons CC0 1.0 license.

  14. „ There was an error while sending your boarding pass“

  15. Current situation Web-UI Me Check-in

  16. Current situation Web-UI Me Check-in Barcode Output Generator Mgmt

  17. Current situation Web-UI Me Check-in Barcode Output Generator Mgmt

  18. Current situation Circuit breaker Web-UI Me Check-in Barcode Output Generator Mgmt

  19. Current situation – the bad part Web-UI Me Check-in Barcode Output Generator Mgmt

  20. Current situation – the bad part Web-UI Me Check-in Barcode Output Generator Mgmt

  21. Current situation – the bad part Web-UI Me Check-in Barcode Output Generator Stateful Mgmt Retry

  22. 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.

  23. Possible situation – much better! Web-UI Me Check-in Barcode Output Generator Mgmt

  24. Possible situation – much better! Web-UI Stateful Retry Me Check-in Barcode Output Generator Mgmt

  25. Possible situation – much better! Web-UI Stateful The failure Retry never leaves Me Check-in this scope! Barcode Output Generator Mgmt

  26. Handling State Persist thing State machine or (Entity, Document , Actor, …) workflow engine Complex, proprietary, DIY = effort, T ypical Scheduling, Versioning, heavyweight, slow, accidental concerns operating, visibility, don‘t scale, complexity scalability , … developer adverse

  27. Workflow engines, state machines It is relevant in modern architectures

  28. Workflow engines, CADENCE state machines Silicon valley has recognized

  29. Workflow engines, CADENCE state machines

  30. Workflow engines, CADENCE state machines also at scale

  31. Workflow engines, CADENCE state machines for todays demo

  32. Live hacking https://github.com/berndruecker/flowing-retail

  33. Now you have a state machine! Credit Payment Card REST

  34. Client Service Provider has to implement has to implement Retry Idempotency

  35. It is a business We are processing your payment. problem Do not leave this page. anyway! And for god sake – do not reload!

  36. It is a business We are currently processing your request. We are processing your payment. problem Don‘t worry, it will happen safely – Do not leave this page. even if you loose connection. anyway! And for god sake – do not reload! Feel free to reload this page any time!

  37. Requirement: Idempotency of services! Photo by pixabay, available under Creative Commons CC0 1.0 license.

  38. Requirement: Idempotency of services! Photo by Chr.Späth , available under Public Domain.

  39. Distributed systems introduce complexity you have to tackle! Credit Payment Card REST

  40. Distributed systems

  41. It is impossible to Client Service differentiate certain Provider failure scenarios. Independant of communication style!

  42. Distributed systems introduce complexity you have to tackle! Credit Payment Card REST

  43. Distributed systems introduce complexity you have to tackle! Credit Payment Card REST

  44. BPMN Business Process Model and Notation ISO Standard

  45. Widespread BPMN Executable Easy to and mature understand* *(for Biz, Dev, and Ops)

  46. Proper Operations Visibility + Context

  47. Compare to e.g. Step Functions

  48. Workflows live within service boundaries Credit Payment Card REST

  49. Workflows live within service boundaries Web-UI Me Check-in Barcode Generato Output r Mgmt

  50. Workflows live within service boundaries Web-UI Me Check-in Barcode Generato Output r Mgmt

  51. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  52. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  53. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  54. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  55. Check-in generateBoardingPass HTTP 200 OK HTTP 202 ACCEPTED Happy case: Synchronous response Otherwise: asynchronous

  56. „The customer wants a synchronous response “ Web-UI Me Check-in „Eh – no !“ Barcode Output Generator Mgmt

  57. Synchronous communication is the crystal meth of distributed programming T odd Montgomery and Martin Thompson in “How did we end up here” at GOT O Chicago 2015

  58. Challenges of asynchronicity

  59. Asynchronous communication Web-UI You need to monitor timeouts Me Check-in Barcode Output Generator Mgmt

  60. Remember … Web-UI The failure never leaves Me Check-in this scope! Barcode Output Generator Mgmt

  61. Workflow…

  62. Workflow…

  63. Client Service Provider has to implement has to implement Timeout, Retry Idempotency

  64. Who uses a message bus?

  65. Who has no problems operating a message bus? Dead messages | No context | Inaccesible payload | Hard to redeliver | Home- grown message hospitals | …

  66. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  67. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  68. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91

  69. Avoids th thundering ering her erds Photo by Gopal Vijayaraghavan, available under Creative Commons BY 2.0 license.

  70. https://aws.amazon.com/de/message/5467D2/ Photo by Gopal Vijayaraghavan, available under Creative Commons BY 2.0 license.

  71. Distributed Distributed T T ransactions ransactions

  72. Distributed systems

  73. “ Grown- Ups Don’t Use Distributed T ransactions Pat Helland Distributed Systems Guru Worked at Amazon, Microsoft & Salesforce

  74. Distributed transactions using compensation * Compensation

  75. Eventual consistency T emporarily inconsistent state But only temporarily!

  76. Live hacking https://github.com/berndruecker/flowing-retail

  77. Client Service Provider has to implement has to offer Timeout, Retry, Compensation Compensation has to implement Idempotency

  78. Client Service Provider Don‘t forget about state has to implement has to offer Timeout, Retry, Compensation Compensation has to implement Idempotency

  79. Event-driven example also available Checkout Order Payment Inventory Shipping Monitor Human T asks H2 H2 https://github.com/flowing/flowing-retail/

  80. Workflows live inside service boundaries

  81. Sales-Order & Order-Fulfillment via Camunda for every order worldwide (Q2 2017: 22,2 Mio )

  82. # 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)

  83. Thank you!

  84. Contact: mail@berndruecker.io @berndruecker Slides: https://berndruecker.io Blog: https://medium.com/berndruecker Code: https://github.com/berndruecker https://www.infoworld.com/article/3254777/ application-development/ 3-common-pitfalls-of-microservices- integrationand-how-to-avoid-them.html https://www.infoq.com/articles/events- workflow-automation https://thenewstack.io/5-workflow-automation- use-cases-you-might-not-have-considered/

Recommend


More recommend