r/cloudcomputing • • Aug 27 '23

Composition vs Aggregation design pattern w.r.t. to microservices?

Can someone please help me understand the difference between these two? Whatever I have read makes them sound exactly the same! Can you please provide an example to understand the difference?

TIA!!

4 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/Obsidian743 Aug 28 '23

The API gateway pattern doesn't do the domain work. It's context agnostic. It just handles routing and cross-cutting concerns like security and content negotiation. In terms of composition and aggregates, we're talking in terms of the worker services within their respective domains/contexts.