I was planing to create an API based on microservices, I'm stuck on how to solve a specific scenario.
Initial plan is, all microservices are only accessible through a REST API.
Based on the next schema, if you want to get all the orders you simply go to
/orders and get a list of them.
But whats happens when you want to get all orders related to a client? You go to
/clients/123/orders and internally
clients make a request to
orders and then
clients returns you the orders list, but don't make any sense to make a internal request to orders, receive a long list from
orders and return that list again to the client from
clients. Also the pagination will be a pain here.
I read about having an accessible view of the orders database from
clients but not sure whats is the best approach for this.