What is a "bounded context" in microservices architecture?
Bounded context is a principle from Domain-Driven Design (DDD) that, in microservices architecture, defines the boundaries of each service's responsibility.
The meaning
Each microservice exists in its own context: it has its own business area, terminology, logic, and data. It does not share a database or models with others and does not interfere with their internal rules.
Example:
- The orders service works with concepts like "product", "status", "payment".
- The delivery service uses "address", "courier", "tracking number". Both talk about orders, but each in its own context, and neither is required to understand the other's internal structures.
Why this is needed
- It removes overlapping logic and dependencies between services.
- It lets different teams develop their parts independently.
- It makes the system scalable and flexible: each service lives in its own domain "zone".
Summary:
A bounded context is a clear boundary around a microservice's business meaning: inside are its own rules and data model, outside there is interaction only through a public API.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.