We have a high read, low write website which currently has monolithic architecture on back end.
We have recently started breaking it into micro-services. We have designed some micro-services - Product, Price, Offers, Content(images, videos, etc...).
There is another micro-service - "Recommend". This service runs a logic and provides similar product ids for a given product id.
On our product page we want to show Product details, prices, offers and a image. This is very similar to Amazon product page. This part looks fairly simple, as we call all micro-services in parallel and compose the required entity.
Next section is of "Similar products" which shows basic details of multiple similar products. This section is similar to Amazon's "Sponsored products" section.
Now as per our current approach, we first invoke "Recommend" service which returns list of product ids. Then we send these ids to all other micro-services to fetch their product details, prices, offers & image.
This approach works fine but there are some points of discussion to it:
Some micro-service calls are dependent on others. We have to wait for first call to complete before we can start with others. As much I've read, people say that all micro-service calls should be as much independent as possible.
Is it even the correct approach? Could there be some better approach such as:
i. Another service that performs this composition and caches composed data. But now this new service will have to listen to changes from all micro services and invalidate cache accordingly. This approach improves overall performance.
ii. Sync some high traffic data like prices to Product micro-service but this increases complexity and makes micro-services somewhat dependent on each other which is against the principles of micro-service.
Would like to know what others are doing in such cases. I checked on StackExchange but could not find something like my problem. Something similar - How to query data from multiple microservices