I have 2 domain objects: project and contract. A project can have many contracts, so in the database it is modeled as a classic one-to-many relationship. Our question is: how do you model above in the context of microservices? Do you (a) have 2 microservices ProjectService and ContractService? or (b) Do you have one ProjectService that includes both projects and contracts?
We think that the answer (a) (i.e. 2 microservices ProjectService and ContractService) implies that it would be necessary to call 2 services to retrieve and save the full hierarchy of project objects. On the other hand, the answer (a) completely separates the Projects from the Contracts, which can be useful in theory, but practically useless, since the Contract cannot logically exist without the Project.
What is the right approach? Is answer (a) an example of a nano service anti-pattern?
source share