← Back to microservices patterns mapdesign
📦
Microservices Pattern
Self-Contained Service
Design services to answer requests from local ownership data instead of chaining synchronous calls.
Detailed Description
A self-contained service avoids runtime dependency chains. It keeps enough local data to complete its responsibility.
The tradeoff is that data is copied through events or replication, so teams must accept and design for eventual consistency.
Visual Diagram
Anti-pattern (chatty): OrderSvc → UserSvc → InventorySvc all in one request = cascading failures Self-Contained (correct): OrderSvc → handles locally syncs data async via events
Tradeoffs
Pros
Fast, resilient, avoids cascading failures
Cons
Data duplication and eventual consistency
Examples: Event-driven microservices with local projections