Skip to content

Commit cc9a6c0

Browse files
committed
docs: update Aggregator Microservices docs
1 parent eacfb13 commit cc9a6c0

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

Diff for: aggregator-microservices/README.md

+31-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ title: Aggregator Microservices
33
category: Architectural
44
language: en
55
tag:
6+
- API design
67
- Cloud distributed
78
- Decoupling
89
- Microservices
910
---
1011

1112
## Intent
1213

13-
The user makes a single call to the aggregator service, and the aggregator then calls each relevant microservice.
14+
Streamline client's interactions with system's microservices by providing a single aggregation point that consolidates data and responses from multiple services. This simplifies the client's communication with the system, improving efficiency and reducing complexity.
1415

1516
## Explanation
1617

1718
Real world example
1819

19-
> Our web marketplace needs information about products and their current inventory. It makes a call to an aggregator
20-
> service which in turn calls the product information microservice and product inventory microservice returning the
21-
> combined information.
20+
> Our web marketplace needs information about products and their current inventory. It makes a call to an aggregator service, which, in turn, calls the product information and product inventory microservices, returning the combined information.
2221
2322
In plain words
2423

@@ -36,7 +35,7 @@ Let's start from the data model. Here's our `Product`.
3635
public class Product {
3736
private String title;
3837
private int productInventories;
39-
// getters and setters ->
38+
// Getters and setters omitted for brevity ->
4039
...
4140
}
4241
```
@@ -94,14 +93,39 @@ curl http://localhost:50004/product
9493

9594
## Class diagram
9695

97-
![alt text](./aggregator-service/etc/aggregator-service.png "Aggregator Microservice")
96+
![Class diagram of the Aggregator Microservices Pattern](./aggregator-service/etc/aggregator-service.png "Aggregator Microservice")
9897

9998
## Applicability
10099

101-
Use the Aggregator Microservices pattern when you need a unified API for various microservices, regardless the client device.
100+
The Aggregator Microservices Design Pattern is particularly useful in scenarios where a client requires a composite response that is assembled from data provided by multiple microservices. Common use cases include e-commerce applications where product details, inventory, and reviews might be provided by separate services, or in dashboard applications where aggregated data from various services is displayed in a unified view.
101+
102+
## Consequences
103+
104+
Benefits:
105+
106+
* Simplified Client: Clients interact with just one service rather than managing calls to multiple microservices, which simplifies client-side logic.
107+
* Reduced Latency: By aggregating responses, the number of network calls is reduced, which can improve the application's overall latency.
108+
* Decoupling: Clients are decoupled from the individual microservices, allowing for more flexibility in changing the microservices landscape without impacting clients.
109+
* Centralized Logic: Aggregation allows for centralized transformation and logic application on the data collected from various services, which can be more efficient than handling it in the client or spreading it across multiple services.
110+
111+
Trade-offs:
112+
113+
* Single Point of Failure: The aggregator service can become a bottleneck or a single point of failure if not designed with high availability and scalability in mind.
114+
* Complexity: Implementing an aggregator can introduce complexity, especially in terms of data aggregation logic and error handling when dealing with multiple services.
115+
116+
## Related Patterns
117+
118+
* [API Gateway](https://java-design-patterns.com/patterns/api-gateway/): The Aggregator Microservices pattern is often used in conjunction with an API Gateway, which provides a single entry point for clients to access multiple microservices.
119+
* [Composite](https://java-design-patterns.com/patterns/composite/): The Aggregator Microservices pattern can be seen as a form of the Composite pattern, where the composite is the aggregated response from multiple microservices.
120+
* [Facade](https://java-design-patterns.com/patterns/facade/): The Aggregator Microservices pattern can be seen as a form of the Facade pattern, where the facade is the aggregator service that provides a simplified interface to the client.
102121

103122
## Credits
104123

105124
* [Microservice Design Patterns](http://web.archive.org/web/20190705163602/http://blog.arungupta.me/microservice-design-patterns/)
106125
* [Microservices Patterns: With examples in Java](https://www.amazon.com/gp/product/1617294543/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=javadesignpat-20&creative=9325&linkCode=as2&creativeASIN=1617294543&linkId=8b4e570267bc5fb8b8189917b461dc60)
107126
* [Architectural Patterns: Uncover essential patterns in the most indispensable realm of enterprise architecture](https://www.amazon.com/gp/product/B077T7V8RC/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=javadesignpat-20&creative=9325&linkCode=as2&creativeASIN=B077T7V8RC&linkId=c34d204bfe1b277914b420189f09c1a4)
127+
* [Building Microservices: Designing Fine-Grained Systems](https://amzn.to/43aGpSR)
128+
* [Microservices Patterns: With examples in Java](https://amzn.to/4a5LHkP)
129+
* [Microservice Architecture: Aligning Principles, Practices, and Culture](https://amzn.to/3T9jZNi)
130+
* [Production-Ready Microservices: Building Standardized Systems Across an Engineering Organization](https://amzn.to/4a0Vk4c)
131+
* [Designing Distributed Systems: Patterns and Paradigms for Scalable, Reliable Services](https://amzn.to/3T9g9Uj)

0 commit comments

Comments
 (0)