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