← 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
Chatty: Client -> A -> B -> C Self-contained: Client -> A A uses local read model Other services sync async
Tradeoffs
Pros
Fast, resilient, avoids cascading failures
Cons
Data duplication and eventual consistency
Examples: Event-driven microservices with local projections