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.

Microservices architecture is it the right choice to design long-living systems @ Codemotion Webinar

187 views

Published on

Microservices all the thing! they say. Nowadays it seems that if architectures are not microservices based they are not worth the name. Is it really true? Do we really need a (micro)services based architecture?
We should design our systems with longevity, manutenability, and evolution simplicity in mind. Not hype. Long living systems are our primary goal. We'll analyze most common errors and we'll see how architecture can be a game changer in systems design.
Join Mauro in a journey that aims to disclose what it means to build a distributed system based on a (micro)services oriented architecture.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Microservices architecture is it the right choice to design long-living systems @ Codemotion Webinar

  1. 1. WEBINARS
  2. 2. is the biggest tech conference for developers in EMEA, open to all languages and technologies.
  3. 3. NEXT CONFERENCES CODEMOTION ROME: March 22-23 CODEMOTION AMSTERDAM: April 2-3
  4. 4. VISIT OUR PLATFORM CODEMOTION.COM
  5. 5. microservices architecture is it the right choice to design long-living systems? Mauro Servienti mauroservienti
  6. 6. All I wanna do when I wake up in the morning is… Rosanna, Toto. Toto IV mauroservienti
  7. 7. Buy a "Banana Protector" mauroservienti
  8. 8. Buy a "Banana Protector" mauroservienti
  9. 9. Shopping Cart Microservice [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart mauroservienti
  10. 10. please, welcome the business mauroservienti
  11. 11. Business requirements (#1) mauroservienti
  12. 12. Products & Shopping Cart Microservices [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price Products mauroservienti
  13. 13. Products & Shopping Cart Microservices [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price Products copy mauroservienti
  14. 14. Business requirements (#2) mauroservienti
  15. 15. Products & Shopping Cart Microservices [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products mauroservienti
  16. 16. Products & Shopping Cart Microservices [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products copy copy mauroservienti
  17. 17. Business requirements (#3) mauroservienti
  18. 18. Products & Shopping Cart Microservices [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products mauroservienti
  19. 19. Products & Shopping Cart Microservices [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products mauroservienti
  20. 20. Products & Shopping Cart Microservices [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Update XYZ Price mauroservienti
  21. 21. service boundaries violation mauroservienti
  22. 22. Price doesn’t feel in the right place - Item ID - Price - Inventory Products mauroservienti
  23. 23. ownership is lost mauroservienti
  24. 24. Suppliers & Products & Shopping Cart [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… - Supplier ID - Item ID - Purchase Price Suppliers Update XYZ Price Are we selling? New Purchase Price mauroservienti
  25. 25. autonomy? puff, it’s gone mauroservienti
  26. 26. HTTP all the rage because it’s the microservices way mauroservienti
  27. 27. Suppliers & Products & Shopping Cart [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… - Supplier ID - Item ID - Purchase Price Suppliers Update XYZ Price Are we selling? New Purchase Price mauroservienti
  28. 28. “the microservices way” Shopping CartProducts Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Suppliers Update XYZ Price Are we selling? New Purchase Price • Incoming “external” HTTP Post • HTTP Query from Suppliers to Products • HTTP Post from Suppliers to Products • HTTP Query from Products to Shopping Cart • HTTP Post from Products to Shopping Cart mauroservienti
  29. 29. The snowball effect [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… - Supplier ID - Item ID - Purchase Price Suppliers Update XYZ Price Are we selling? New Purchase Price Ooops... mauroservienti
  30. 30. temporal coupling anyone? mauroservienti
  31. 31. The snowball effect: can we rollback? [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… - Supplier ID - Item ID - Purchase Price Suppliers Update XYZ Price Are we selling? New Purchase Price Ooops... mauroservienti
  32. 32. distributed transactions over HTTP mauroservienti
  33. 33. mauroservienti
  34. 34. Messaging temporal coupling and distributed transactions mauroservienti
  35. 35. The snowball effect [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… - Supplier ID - Item ID - Purchase Price Suppliers Update XYZ Price Are we selling? New Purchase Price Ooops... mauroservienti
  36. 36. The snowball effect [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products - Supplier ID - Item ID - Purchase Price Suppliers New Purchase Price + new price details Business Logic Purchase Price Changed + new price details Business Logic Sell Price Changed MovetoSavedfor… mauroservienti
  37. 37. The snowball effect [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart + new price details Business Logic Sell Price Changed MovetoSavedfor… Ooops... mauroservienti
  38. 38. palliative alleviates the symptoms mauroservienti
  39. 39. Queries are still a thing: Add item to cart. [ list-of ] - Item ID - Price - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products copy price copy inventory mauroservienti
  40. 40. Data sharing is still a thing [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart + new price details Business Logic Sell Price Changed MovetoSavedfor… mauroservienti
  41. 41. We’re flooding the system… Shopping CartProducts Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Is item XYZ in a cart? Swap & Insert Prices Move to Saved for… Is item XYZ in a cart? Update XYZ inventory Update XYZ Price Update XYZ Inventory Over and over, and over, and over… mauroservienti
  42. 42. http://montages.no/2009/09/begrepet-grafisk-likhet/ mauroservienti
  43. 43. User mental model is misleading [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description Shopping Cart - Item ID - Price - Inventory Products - Supplier ID - Item ID - Purchase Price Suppliers mauroservienti
  44. 44. Let’s focus on the Shopping Cart [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity - Inventory - Name - Description - Etc… Shopping Cart mauroservienti
  45. 45. Sales shopping cart [ list-of ] - Item ID - Quantity - Inventory - Name - Description - Delivery Est. Shopping Cart - Item ID - Price Sales [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity mauroservienti
  46. 46. - Item ID - Price Sales [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity Warehouse shopping cart [ list-of ] - Item ID - Quantity - Name - Description - Delivery Est. Shopping Cart [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory mauroservienti
  47. 47. Shipping shopping cart [ list-of ] - Item ID - Quantity - Name - Description Shopping Cart [ list-of ] - Cart ID - Item ID - Quantity - Delivery Est. - Item ID - Price Sales [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory - Item ID - Delivery Type Shipping mauroservienti
  48. 48. Marketing tends to be stable [ list-of ] - Item ID - Quantity Shopping Cart [ list-of ] - Cart ID - Item ID - Quantity - Delivery Est. - Item ID - Price - Item ID - Name - Description Marketing Sales [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory - Item ID - Delivery Type Shipping mauroservienti
  49. 49. Do we need the Shopping Cart at all? [ list-of ] - Item ID - Quantity Shopping Cart [ list-of ] - Cart ID - Item ID - Quantity - Delivery Est. - Item ID - Price - Item ID - Name - Description Marketing Sales [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory - Item ID - Delivery Type Shipping mauroservienti
  50. 50. Can Sales be responsible for that concept? [ list-of ] - Cart ID - Item ID - Quantity - Delivery Est. - Item ID - Price - Item ID - Name - Description Marketing Sales Cart ID [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory - Item ID - Delivery Type Shipping mauroservienti
  51. 51. We followed the coupling [ list-of ] - Cart ID - Item ID - Quantity - Delivery Est. - Item ID - Price - Item ID - Name - Description Marketing Sales Cart ID [ list-of ] - Item ID - CurrentPrice - LastPrice - Quantity [ list-of ] - Cart ID - Item ID - Inventory - Quantity Warehouse - Item ID - Inventory - Item ID - Delivery Type Shipping mauroservienti
  52. 52. What a (micro)service is the technical authority for a specific business capability All business rules (& data) reside within the service mauroservienti
  53. 53. Full Vertical Slices MarketingSales Warehouse Shipping behavior & databehavior & data behavior & databehavior & data mauroservienti
  54. 54. Full Vertical Slices MarketingSales Warehouse Shipping behavior & databehavior & data behavior & databehavior & data UI & ViewModel Composition UI & ViewModel Composition UI & ViewModel Composition UI & ViewModel Composition mauroservienti
  55. 55. Full Vertical Slices MarketingSales Warehouse Shipping behavior & databehavior & data behavior & databehavior & data UI & ViewModel Composition UI & ViewModel Composition UI & ViewModel Composition UI & ViewModel Composition Dedicated Technology / FX Dedicated Technology / FX Dedicated Technology / FX Dedicated Technology / FX mauroservienti
  56. 56. time tyranny Demo bit.ly/codemotion-webinar-microservices mauroservienti
  57. 57. Takeaways • Boundaries are key to success • Do not bring in more technology to solve non- technical problems mauroservienti
  58. 58. Takeaways • Boundaries are key to success • Mental model can badly influence design • Users/Business analysts tend to think in term of data presentation mauroservienti
  59. 59. Takeaways • Boundaries are key to success • Mental model can badly influence design • Do not name things prematurely • Premature names stick and drive data aggregation mauroservienti
  60. 60. Takeaways • Boundaries are key to success • Mental model can badly influence design • Do not name things prematurely • Behaviors define how to aggregate data • Group data that change together and that influence each other • Use anti-requirements techniques to validate data grouping • Follow the coupling mauroservienti
  61. 61. Takeaways • Boundaries are key to success • Mental model can badly influence design • Do not name things prematurely • Behaviors define how to aggregate data • Use messaging to temporally decouple services mauroservienti
  62. 62. ViewModel Composition //milestone.topics.it
  63. 63. you don’t need a distributed system first rule of distributed systems mauroservienti
  64. 64. Q&A Thank you! mauroservienti

×