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 easywaywrongway

24 views

Published on

Slides for the presentation on Microservices -- The Easy Way is the Wrong Way. The presentation is meant to show that to do microservices well a lot of other details are required.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Microservices easywaywrongway

  1. 1. Microservices – The Easy Way is the Wrong Way
  2. 2. Microservices – The Easy Way is the Wrong Way Goal Show that Microservice Architecture takes more consideration than you may expect
  3. 3. Microservices – The Easy Way is the Wrong Way Agenda  What are microservices  Why should I use them  When should I NOT use them  Challenges  Decomposition (high-level)
  4. 4. Microservices – The Easy Way is the Wrong Way What are microservices
  5. 5. Microservices – The Easy Way is the Wrong Way What are microservices  Independent applications  Communicate over network  Has single responsibility  Owned by one team  Individually deployable  Architecture style
  6. 6. Microservices – The Easy Way is the Wrong Way What are microservices Monolith
  7. 7. Microservices – The Easy Way is the Wrong Way What are microservices Monolith Microservices extract new
  8. 8. Microservices – The Easy Way is the Wrong Way What are microservices Monolith Microservices • Move functionality • Add functionality • Rare total migration
  9. 9. Microservices – The Easy Way is the Wrong Way The microservice architecture is an implementation of Distributed Computing
  10. 10. Microservices – The Easy Way is the Wrong Way Why should I use microservices To deliver business functionality  Quicker  Safer  Stability
  11. 11. Microservices – The Easy Way is the Wrong Way Why should I use microservices Team Autonomy - Best language for the job - Focused development - Agile works well Team Autonomy Service Autonomy Scalability Fault Isolation
  12. 12. Microservices – The Easy Way is the Wrong Way Why should I use microservices Service Autonomy - Single Responsibility - Deployable without other services Team Autonomy Service Autonomy Scalability Fault Isolation
  13. 13. Microservices – The Easy Way is the Wrong Way Why should I use microservices Scalability - Scale independent of others - Choice of servers Team Autonomy Service Autonomy Scalability Fault Isolation
  14. 14. Microservices – The Easy Way is the Wrong Way Why should I use microservices Fault Isolation - Your problems aren’t my problems - “Stay in your lane bro” Team Autonomy Service Autonomy Scalability Fault Isolation A B C D E X
  15. 15. Microservices – The Easy Way is the Wrong Way Who uses microservices
  16. 16. Microservices – The Easy Way is the Wrong Way Why should I NOT use microservices
  17. 17. Microservices – The Easy Way is the Wrong Way THEY’RE HARD!!! This Photo by Unknown Author is licensed under CC BY-SA-NC So is good programming, but… Why should I NOTuse microservices
  18. 18. Microservices – The Easy Way is the Wrong Way Why should I NOTuse microservices • Monolith is too small • Too much coupling – need refactoring first • Team unwilling or not ready • No support structure • High cost of time and money
  19. 19. Microservices – The Easy Way is the Wrong Way Challenges to making microservices
  20. 20. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Easy Reality Cheap Cost time, money, learning, investing HTTP to IP address Messaging; RPC; sync vs async; pub/sub Copy files to servers CI / CD pipeline per Microservice Single Repo Should use Repo per Microservice Network not my job Need to know about OSI Model; Layer 4 and 7 Security non-issue TLS for service communication layer; OAuth for application layer Common Code Sharing code keeps services tightly coupled
  21. 21. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • HTTP7. Application 6. Presentation 5. Session • TCP / UDP4. Transport • IP / ARP / ICMP / IGMP3. Network 2. Data Link 1. Physical
  22. 22. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Service A V1.0 Team A Team B Service B V1.0Nuget Package Service A V2.0
  23. 23. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Service A V1.0 Team A Team B Service B V1.0Nuget Package Service A V2.0 Service B V2.0 Changes in Package for Service A kept Service B from working.
  24. 24. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Service A V1.0 Team A Team B Service B V1.0 Nuget Package Foo Service A V2.0 Service B V2.0 Nuget Package Goo Nuget Package Bar
  25. 25. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Nuget Package Common Nuget Package Svc B Nuget Package Svc A Separate code that changes to their own package for the service that needs it.
  26. 26. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Distributed monolith Monolith Microservice Monolith 2 This Photo by Unknown Author is licensed under CC BY-SA
  27. 27. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Decentralized Data Monolith Accounts Customers Orders Order History Parts Parts1 Shipping History Logging
  28. 28. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Decentralized Data Orders -parts ~~ ~~~ ~~~~~ ~~~ Parts
  29. 29. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Decentralized Data Orders -parts Parts Shipping - orders
  30. 30. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Id Natural Key Part Number Part Name Category Classification Description Size Description Color Container Manufacturer Mfg Part Number Mfg Date Replaces Part Number Discontinued Date Parts
  31. 31. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Id Natural Key Part Number Part Name Description Parts Orders -parts Orders ~~~~~~~ ~~~~ ~~~~~~~~~~~ ~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~OrderedParts Id OrderId Part Id Part Number Part Name Description Quantity Price
  32. 32. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Message Bus Messaging
  33. 33. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices
  34. 34. Microservices – The Easy Way is the Wrong Way Monolith Microservices extract new Decomposing Monolith to Microservices
  35. 35. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Monolith • Boundaries not clearly defined • Lacking good Dependency Injection • Requires refactoring
  36. 36. Microservices – The Easy Way is the Wrong Way Monolith Decomposing Monolith to Microservices Start With Small Piece Payoff in • Learning • Building Infrastructure
  37. 37. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Company: Wham-Bam Products: Fidget Widgets Production
  38. 38. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Production Shipping Purchasing Domain Model Event Storming
  39. 39. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Event Storming Production Shipping Purchasing Inventory Invoicing Returns Accounts3rd Party Domain Model
  40. 40. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Bounded Contexts Production Parts Purchasing Parts Products Vendors Order
  41. 41. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Bounded Contexts Production Parts Purchasing Parts Products Vendors Order Ubiquitous Language
  42. 42. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Aggregates Order Order Line Product Part Both of these are in the Production Bounded Context
  43. 43. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Identify Possible Services • Submit Order • Ship Order • Cancel Order • Revise Order Order Order Line Product Part Order Microservice Production Bounded Context
  44. 44. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Microservice Bounded ContextBounded Context Microservice Bounded Context
  45. 45. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Microservice Bounded ContextBounded Context Microservice Bounded Context
  46. 46. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Microservice Bounded ContextBounded Context Microservice Bounded Context Bounded Context “Cross-Cutting Concerns”
  47. 47. Microservices – The Easy Way is the Wrong Way A Quick Review This Photo by Unknown Author is licensed under CC BY-SA-NC Microsevices are hard They require good analysis and teamwork Team Autonomy Service Autonomy Scalability Fault Isolation Cost time, money, learning, investing Messaging; RPC; sync vs async; pub/sub CI / CD setup per microservice Sharing code keeps services tightly coupled Need to know about Layer 4 and 7 TLS for service communication layer; OAuth for application layer
  48. 48. Microservices – The Easy Way is the Wrong Way A Quick Review Domain Driven Design Bounded Contexts Aggregates
  49. 49. Microservices – The Easy Way is the Wrong Way Recommendations Microservices Patterns – Chris Richardson Domain-Driven Design: Tackling Complexity in the Heart of Software – Eric Evans Implementing Domain Driven Design – Vernon Vaughn
  50. 50. Microservices – The Easy Way is the Wrong Way Recommendations Micro-Frontends – O’Reilly class by Luca Mezzalira https://learning.oreilly.com/live-training https://medium.com/@lucamezzalira/micro-frontends-resources-53b1ec7d12a
  51. 51. Microservices – The Easy Way is the Wrong Way Thank You Sean Whitesell @seanw122 seanwhitesell.com President of Tulsa .NET User Group && Cloud Architect @ TokenEx, LLC
  52. 52. Non-Related Resources https://Presentations.dotnetfoundation.org https://dotnet.microsoft.com/learn/videos https://github.com/dotnet- presentations/dotnetconf2019/tree/master/Technical

×