SlideShare a Scribd company logo
1 of 52
Microservices – The Easy Way is the Wrong Way
Microservices – The Easy Way is the Wrong Way
Goal
Show that
Microservice Architecture takes
more consideration than you
may expect
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)
Microservices – The Easy Way is the Wrong Way
What are microservices
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
Microservices – The Easy Way is the Wrong Way
What are microservices
Monolith
Microservices – The Easy Way is the Wrong Way
What are microservices
Monolith Microservices
extract
new
Microservices – The Easy Way is the Wrong Way
What are microservices
Monolith Microservices
• Move functionality
• Add functionality
• Rare total migration
Microservices – The Easy Way is the Wrong Way
The microservice architecture is an implementation of
Distributed Computing
Microservices – The Easy Way is the Wrong Way
Why should I use microservices
To deliver business functionality
 Quicker
 Safer
 Stability
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
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
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
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
Microservices – The Easy Way is the Wrong Way
Who uses microservices
Microservices – The Easy Way is the Wrong Way
Why should I NOT use microservices
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
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
Microservices – The Easy Way is the Wrong Way
Challenges to making microservices
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
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
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
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.
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
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.
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
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
Microservices – The Easy Way is the Wrong Way
Challenges to making microservices
• Decentralized Data
Orders
-parts
~~
~~~
~~~~~
~~~
Parts
Microservices – The Easy Way is the Wrong Way
Challenges to making microservices
• Decentralized Data
Orders
-parts
Parts
Shipping
- orders
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
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
Microservices – The Easy Way is the Wrong Way
Challenges to making microservices
Message Bus
Messaging
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Microservices – The Easy Way is the Wrong Way
Monolith Microservices
extract
new
Decomposing Monolith to Microservices
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Monolith
• Boundaries not clearly defined
• Lacking good Dependency Injection
• Requires refactoring
Microservices – The Easy Way is the Wrong Way
Monolith
Decomposing Monolith to Microservices
Start With Small Piece
Payoff in
• Learning
• Building Infrastructure
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Using DDD
Company: Wham-Bam
Products: Fidget Widgets
Production
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Production Shipping
Purchasing
Domain Model
Event Storming
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Event Storming
Production Shipping
Purchasing
Inventory
Invoicing
Returns
Accounts3rd
Party
Domain Model
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Using DDD
Bounded Contexts
Production
Parts
Purchasing
Parts
Products
Vendors
Order
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
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
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
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Microservice
Bounded ContextBounded Context
Microservice
Bounded Context
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Microservice
Bounded ContextBounded Context
Microservice
Bounded Context
Microservices – The Easy Way is the Wrong Way
Decomposing Monolith to Microservices
Microservice
Bounded ContextBounded Context
Microservice
Bounded Context
Bounded Context
“Cross-Cutting Concerns”
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
Microservices – The Easy Way is the Wrong Way
A Quick Review
Domain Driven Design
Bounded Contexts
Aggregates
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
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
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
Non-Related Resources
https://Presentations.dotnetfoundation.org
https://dotnet.microsoft.com/learn/videos
https://github.com/dotnet-
presentations/dotnetconf2019/tree/master/Technical

More Related Content

Similar to Microservices easywaywrongway

Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
Angelos Kapsimanis
 

Similar to Microservices easywaywrongway (20)

Dismantling the Monolith: Scaling with Microservices
Dismantling the Monolith: Scaling with MicroservicesDismantling the Monolith: Scaling with Microservices
Dismantling the Monolith: Scaling with Microservices
 
Surviving as a Monolith in a Microservices World - by Blair Olynyk, Hyperwallet
Surviving as a Monolith in a Microservices World - by Blair Olynyk, HyperwalletSurviving as a Monolith in a Microservices World - by Blair Olynyk, Hyperwallet
Surviving as a Monolith in a Microservices World - by Blair Olynyk, Hyperwallet
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
Discussion About Microservices Architecture
Discussion About Microservices ArchitectureDiscussion About Microservices Architecture
Discussion About Microservices Architecture
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
 
Microserces Architecture
Microserces ArchitectureMicroserces Architecture
Microserces Architecture
 
Microservices in Practice
Microservices in PracticeMicroservices in Practice
Microservices in Practice
 
What is Microservices
What is MicroservicesWhat is Microservices
What is Microservices
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
 
Microevent
MicroeventMicroevent
Microevent
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.it
 
Microservices - The good, The bad, The does and The don'ts
Microservices - The good, The bad, The does and The don'tsMicroservices - The good, The bad, The does and The don'ts
Microservices - The good, The bad, The does and The don'ts
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Microservices: an introduction
Microservices: an introductionMicroservices: an introduction
Microservices: an introduction
 
Isn't the Monolith Just Enough?
Isn't the Monolith Just Enough?Isn't the Monolith Just Enough?
Isn't the Monolith Just Enough?
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 

Microservices easywaywrongway

  • 1. Microservices – The Easy Way is the Wrong Way
  • 2. Microservices – The Easy Way is the Wrong Way Goal Show that Microservice Architecture takes more consideration than you may expect
  • 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. Microservices – The Easy Way is the Wrong Way What are microservices
  • 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. Microservices – The Easy Way is the Wrong Way What are microservices Monolith
  • 7. Microservices – The Easy Way is the Wrong Way What are microservices Monolith Microservices extract new
  • 8. Microservices – The Easy Way is the Wrong Way What are microservices Monolith Microservices • Move functionality • Add functionality • Rare total migration
  • 9. Microservices – The Easy Way is the Wrong Way The microservice architecture is an implementation of Distributed Computing
  • 10. Microservices – The Easy Way is the Wrong Way Why should I use microservices To deliver business functionality  Quicker  Safer  Stability
  • 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. 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. 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. 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. Microservices – The Easy Way is the Wrong Way Who uses microservices
  • 16. Microservices – The Easy Way is the Wrong Way Why should I NOT use microservices
  • 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. 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. Microservices – The Easy Way is the Wrong Way Challenges to making microservices
  • 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. 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. 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. 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. 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. 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. 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. 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. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Decentralized Data Orders -parts ~~ ~~~ ~~~~~ ~~~ Parts
  • 29. Microservices – The Easy Way is the Wrong Way Challenges to making microservices • Decentralized Data Orders -parts Parts Shipping - orders
  • 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. 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. Microservices – The Easy Way is the Wrong Way Challenges to making microservices Message Bus Messaging
  • 33. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices
  • 34. Microservices – The Easy Way is the Wrong Way Monolith Microservices extract new Decomposing Monolith to Microservices
  • 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. Microservices – The Easy Way is the Wrong Way Monolith Decomposing Monolith to Microservices Start With Small Piece Payoff in • Learning • Building Infrastructure
  • 37. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Company: Wham-Bam Products: Fidget Widgets Production
  • 38. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Production Shipping Purchasing Domain Model Event Storming
  • 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. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Using DDD Bounded Contexts Production Parts Purchasing Parts Products Vendors Order
  • 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. 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. 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. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Microservice Bounded ContextBounded Context Microservice Bounded Context
  • 45. Microservices – The Easy Way is the Wrong Way Decomposing Monolith to Microservices Microservice Bounded ContextBounded Context Microservice Bounded Context
  • 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. 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. Microservices – The Easy Way is the Wrong Way A Quick Review Domain Driven Design Bounded Contexts Aggregates
  • 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. 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. 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