- Microservices Design Patterns Tutorial
- Microservices Design Patterns - Home
- Microservices Design Patterns - Overview
- Decomposition Design Patterns
- Decompose by Business Capability
- Decompose by Subdomain
- Decompose by Strangler
- Integration Design Patterns
- API Gateway
- Client Side UI Composition
- Chain Of Responsibilities
- Database Design Patterns
- Database per Service
- Shared Database per Service
- Command Query Responsibility Segregator
- Aysynchronous Messaging
- Event Sourcing
- Observability Design Patterns
- Log Aggregation
- Performance Metrics
- Distributed Tracing
- Health Check
- Cross Cutting Concern Design Patterns
- External Configuration
- Service Discovery
- Circuit Breaker
- Blue Green Deployment
- Useful Resources
- Quick Guide
- Useful Resources
Decompose By Subdomain
Microservice architecture structures an application as a set of loosely coupled microservices and each service should be developed independently in agile manner to enable continous delivery/deployment. When a large, complex application is to be built using microservice architecture, the major problem is how to design loosely coupled microservices or to break a large application into small loosely coupled services?
We can define a microservice corresponding to Domain-Driven Design(DDD) subdomains. DDD refers to business as a domain and a domain can have multiple subdomains. Now each subdomain refers to different areas. For Example −
Order Management − Order Management subdomain refers to Orders.
Customer Management − Customer Management subdomain refers to Customers.
Subdomains can be further classified using following criterias −
Core − Most important and key differentiator of an application.
Supporting − Business related and are used to support the business activities.
Generic − Not specific to business but are used to enhance the business operations.
Consider an example of an Online Book Store. It can have following subdomains and corresponding microservices −
Books Catalog Management
Stable Architecture − As business subdomains are stable, this architecture is highly stable.
Cross-functional Teams − Development Teams works independently, are cross-functional and are organized around functional features instead of technical features.
Loosely Coupled Services − Developed services will be loosely coupled and cohesive.
Need good understand of Business − Business subdomains needs be indentified after understanding the business. Understanding organizational structure can help as organizations are structured based on their capabilities.
High Level Domain Model needed − Business domain objects required as they corresponds to business subdomains.
Kickstart Your Career
Get certified by completing the courseGet Started