microservices smaller is better
play

Microservices Smaller is Better? Eberhard Wolff Freelance - PowerPoint PPT Presentation

Microservices Smaller is Better? Eberhard Wolff Freelance consultant & trainer http://ewolff.com Why Microservices? Eberhard Wolff - @ewolff Why Microservices? Strong modularization Sustainable Replaceability Development speed


  1. Microservices Smaller is Better? Eberhard Wolff Freelance consultant & trainer http://ewolff.com

  2. Why Microservices? Eberhard Wolff - @ewolff

  3. Why Microservices? Strong modularization Sustainable Replaceability Development speed Small units Continuous Delivery Deployment less risky Free Choice of technology Eberhard Wolff - @ewolff

  4. Microservice 
 = 
 Micro? Eberhard Wolff - @ewolff

  5. Smaller modules better 10-100LOC http://yobriefca.se/blog/ 2013/04/28/micro-service-architecture/ Eberhard Wolff - @ewolff

  6. Smaller modules better 10-100LOC http://yobriefca.se/blog/ 2013/04/28/micro-service-architecture/ Eberhard Wolff - @ewolff

  7. Game of Life Eberhard Wolff - @ewolff

  8. Game of Life in one line of APL life ← { ⍝ John Conway's "Game of Life". 
 ↑ 1 ⍵ ∨ . ∧ 3 4=+/,¯1 0 1 ∘ . ⊖ ¯1 0 1 ∘ . ⌽ ⊂ ⍵ ⍝ Expression for next generation. 
 } LOC is really a bad metric dyalog.com Eberhard Wolff - @ewolff

  9. Larger? • Microservices have an overhead • Build & deployment pipeline • Version control Eberhard Wolff - @ewolff

  10. 1 st Law of Distributed Objects • Don’t Distribute Your Objects! • Too much remote communication & overhead • Lesson learned from CORBA etc • http://martinfowler.com/bliki/ FirstLaw.html Eberhard Wolff - @ewolff

  11. Latency Round Trip: 0,2-0,5 ms Request = 600.000-1.500.000 instructions@3GHz Processing Response Eberhard Wolff - @ewolff

  12. 1 st Law of Distributed Objects & Microservices • Small Microservices = lot of communication • Violates the 1 st Law • Seems to work, though • http://martinfowler.com/articles/ distributed-objects- microservices.html Eberhard Wolff - @ewolff

  13. Too small = 
 too much communication Eberhard Wolff - @ewolff

  14. L Eberhard Wolff - @ewolff

  15. Again: 
 Why Microservices? Eberhard Wolff - @ewolff

  16. The main reason Eberhard Wolff - @ewolff

  17. Business relevant Eberhard Wolff - @ewolff

  18. How to scale agile? Implement more feature Eberhard Wolff - @ewolff

  19. Conways Law Eberhard Wolff - @ewolff

  20. The Law That I Must Not Name Architecture copies communication structures of the organization Eberhard Wolff - @ewolff

  21. Conway’s Law as an Enabler • Desired architecture = project structure • Microservices belong to one team • Team should be responsible for meaningful features • Ideal: Independent features Eberhard Wolff - @ewolff

  22. Each team can build and deploy features independently! Eberhard Wolff - @ewolff

  23. Microservices must provide a sensible set of functionality Eberhard Wolff - @ewolff

  24. Conway’s Law & Microservice Size • Upper limit: What a (small) team can handle • …and a meaningful set of features • Probably not too small • Lower limit: Depends on overhead / technology Eberhard Wolff - @ewolff

  25. Microservice = Micro? • Size doesn’t matter too much • Teams must be able to work independently • Small enough for one team • Not too much overhead Eberhard Wolff - @ewolff

  26. Conway’s Law Product Owner Feature Service Service Eberhard Wolff - @ewolff

  27. 
 Bad architecture? 
 Still can’t be avoided! Eberhard Wolff - @ewolff

  28. Conway’s Law Product Owner Product Owner Feature Priority? Communication Slow Service Service Eberhard Wolff - @ewolff

  29. Conway’s Law • Software Interface = Team Communication • Too much communication if you get the architecture wrong. • Slows down the process Eberhard Wolff - @ewolff

  30. Collective Code Ownership

  31. Conway’s Law Product Owner Product Owner Feature Review Pull Request Change Service Service Eberhard Wolff - @ewolff

  32. Microservice & Collective Code Ownership • Team might change any service • Reviews can still be done • …or use Pull Requests • More devs can work on a services • Resilience against personnel turnover • Faster Eberhard Wolff - @ewolff

  33. Microservice & Collective Code Ownership • Team must understand bigger parts of the code • Technology freedom? Eberhard Wolff - @ewolff

  34. Refactoring

  35. Refactoring Service Service Different libraries Different language Possibly a rewrite Eberhard Wolff - @ewolff

  36. Limited Technology Set • Easier Refactoring • Easier to follow standards for deployment, monitoring etc • Easier to implement e.g. resilience • Netflix uses a lot of Java Eberhard Wolff - @ewolff

  37. Refactoring Service Service Library Releases must be coordinated …and we want independent releases Enforces same language / platform Hard to implement really reusable code Like: really, really hard Eberhard Wolff - @ewolff

  38. Refactoring Service Service Service Remote communication Slower calls Unreliable network Not great But best option Eberhard Wolff - @ewolff

  39. Number of Services will increase

  40. Refactoring across Services hard

  41. Start BIG • Conway’s law: Upper size = what a team can handle • Refactoring inside a service easier • …needed for agile environments • …where Microservices are used • Number will increase anyway • Tear apart easier than join Eberhard Wolff - @ewolff

  42. If You Start Small… • You will get the architecture wrong • Functionality hard to move • Services not too large at the beginning anyway • Fast deployment still possible Eberhard Wolff - @ewolff

  43. Systems can not be engineered

  44. Systems grow.

  45. Guide growth.

  46. Sum Up

  47. Collective Code Conway’s Law Ownership or Microservices Refactoring Start BIG Faster Time-to- Market Eberhard Wolff - @ewolff

  48. Thank You! Eberhard Wolff - @ewolff

Recommend


More recommend