Top Microservices Design Patterns for Building Applications
This article explains what microservices are, outlines essential design principles, and details the most important microservices design patterns—including Aggregator, API Gateway, Chain of Responsibility, Asynchronous Messaging, Shared Database, Event Sourcing, Branch, CQRS, Circuit Breaker, and Decomposition—to help developers build robust, scalable applications.
What Is a Microservice?
Microservices, also known as microservice architecture, is an architectural style that builds an application as a collection of small, autonomous services modeled around business domains, each implementing a single business capability.
Principles for Designing Microservice Architecture
Independent autonomous services
Scalability
Decentralization (empowerment)
Resilience
Real‑time load balancing
High availability
Continuous delivery through DevOps integration
Seamless API integration and continuous monitoring
Fault isolation
Automatic configuration
Microservice Design Patterns
Aggregator Pattern
The Aggregator collects data from multiple services, applies business logic, and exposes a unified REST endpoint, reducing duplication and allowing independent scaling of the underlying services.
API Gateway Pattern
An API Gateway acts as a single entry point for clients, routing requests to appropriate microservices, handling protocol translation, authentication, authorization, and response aggregation.
Chain of Responsibility (Linked) Pattern
In this pattern, services are arranged in a chain where each service processes the request and passes it to the next; the client receives a response only after the entire chain completes.
Asynchronous Messaging Pattern
Requests are placed on a message queue, allowing services to communicate without waiting for synchronous responses, thus preventing client blocking.
Database or Shared Data Pattern
Each microservice can have its own database to avoid data duplication, or multiple services can share a database when necessary, with careful consideration of consistency and normalization.
Event Sourcing Pattern
All state changes are stored as a sequence of events, enabling reconstruction of application state at any point and providing an audit trail.
Branch Pattern
The Branch pattern routes a request to multiple independent services in parallel, aggregating their responses, which is useful for scenarios like e‑commerce where data comes from various sources.
Command Query Responsibility Segregation (CQRS) Pattern
CQRS separates write (command) operations from read (query) operations, often using event sourcing to update materialized views for efficient querying.
Circuit Breaker Pattern
A circuit breaker prevents cascading failures by stopping calls to a failing service after a threshold is reached, allowing fallback behavior and automatic recovery attempts.
Decomposition Pattern
Decomposition breaks a monolithic application into smaller services based on business capabilities or sub‑domains, often guided by domain‑driven design and bounded contexts.
Strangler (Vine) Pattern
The Strangler or Vine pattern incrementally replaces parts of a legacy monolith with new microservices, routing traffic to the new services while gradually decommissioning the old system.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architects Research Society
A daily treasure trove for architects, expanding your view and depth. We share enterprise, business, application, data, technology, and security architecture, discuss frameworks, planning, governance, standards, and implementation, and explore emerging styles such as microservices, event‑driven, micro‑frontend, big data, data warehousing, IoT, and AI architecture.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
