How To Model Services
How To Model Services
Services
By Abhijeet Gole
Autonomous
Autonomous
• Failure is first step to
success
What Makes a
Good Service? • key concepts
• loose coupling
• high cohesion
• When services are loosely coupled, a change to
one service should not require a change to
another.
• The whole point of a microservice is being able to
make a change to one service and deploy it,
Loose Coupling without needing to change any other part of the
system.
• A loosely coupled service knows as little as it
needs to about the services with which it
collaborates.
• We want related behavior to sit together,
and unrelated behavior to sit elsewhere.
• Making changes in lots of different
High Cohesion places is slower, and deploying lots of
services at once is risky—both of which
we want to avoid.
• Things that do not need to be communicated outside
as well as things that are shared externally with
other bounded contexts
The Bounded • Each bounded context has an explicit interface,
where it decides what models to share with other
Context contexts.
• A specific responsibility enforced by explicit
boundaries
Shared and Hidden Models
Shared model between Warehouse and Finance
• Identify what model to share and which
ones to hide
Modules and • Helps to avoid tight coupling
The bounded contexts inside the warehouse being Microservices representing nested bounded
popped up into their own top-level contexts contexts hidden inside the warehouse