In microservices retreving can be a challenge because the data is present in different databases owned by different microservices. API Composition , CQRS are commonly used query patterns in microservices architecture.

API Composition pattern

This pattern uses an API composer, or aggregator, to handling a query by invoking individual microservices that own the data. It then combines the results (sometimes by performing an in-memory join).

Key points to remember

Disadvantages of API Composition

CQRS(command query responsibility seggregation)

CQRS separates the data model into a read data model and write data model(create/update/delete). CQRS can be used as alternative api composition. Read more here.