I am developing an App for restaurants to manage the products they have and the orders from the costumers. So I’m facing issues when designing the microservices arch. I thought of having one ProductManagementService and another OrderService. But the problem I am facing is that the OrderService should have acces to the Products table from my databas and to access info like their prices and so does the ProductManagementService for obvious reasons.
What should I do in this situation? I thought I have 2 choices. Either sharing a database between these 2 services or either the OrderService asking every time the ProductManagementService for the products info but I think this 2nd option would make OrderService too dependant on ProductManagementService since it’d have to call it every time an order is placed making them too coupled.
Is there any other way of making this work with different databases? I thought of having 2 different databases with the same table synced but I don’t know if this a good approach.