In Microservices is it acceptable to have an API returning an Aggregate Root that was replicated?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


In Microservices is it acceptable to have an API returning an Aggregate Root that was replicated?



Imagine we have a microservice M1 with an aggregate root called Player and a microservice M2 with an aggregate root called Classification, now in the M1 we need to do some logic based on some property from Classification, now some steps to do that are:


Player


Classification


Classification



Ok, now imagine we have a view to add Players, and in that view is possible to choose the Classification of the new Player from a dropdown list. Now the question:


Classification


Player



Should the dropdown list be populated with the Classifications that were replicated into M1 or from M2?



As you can see, by using the data from M1 we would have to expose the Classification from M1 via an API, thus the title of the question.


Classification




1 Answer
1



I believe both can be done and one is not better than the other. Either ways, you're making API call to M2 to get the classification. But this scenario is now telling you that the service boundary might be wrong - the vertical slice on the view to create a new player perhaps should be a single micro-service. Of course, you will add some fallback mechanism for the call to M2 so that in case of failure to M2, M1 doesn't fail completely (in this case, to create a new player).


classification






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived