Back to Catalog
Microservices
Resilience
Self-Contained Service
Design services to respond without blocking on calls to other services.
Intent & Description
Real-world Use Case
Order Service needs menu data to validate an order. Instead of calling Restaurant Service on every POST /orders, it keeps a local MenuReplica (updated via events). createOrder() responds in <100ms, fully self-contained.
Source
📌 TL;DR
Self-contained service = does its job using only local data. Fast, resilient, eventually consistent. Essential for high-availability command handlers.
Advantages
- Low latency — no synchronous cross-service calls on the hot path
- High availability — not dependent on other services being up at request time
- Resilient to downstream failures
- Simpler request flow — no distributed call chain to trace
Disadvantages
- Local data is eventually consistent — commands may act on slightly stale data
- Requires event subscription infrastructure to keep replicas fresh
- More storage per service (local replicas)
- Complex to keep replicas in sync across multiple data sources