I am exploring using a microservice architecture. Among others, this would include three services, an Orders Service, a Products Service, and a Fulfillment Service.
Let’s say the Fulfillment Service needs information about an order. What would be the more common and most accepted method for Fulfillment Service to access the order information?
Fulfillment Service requests order data directly from Order Service via HTTP.
Both Fulfillment Service and Order Service track copies of order data in their own databases. When orders are created, updated, or canceled, a message would be published which both services would listen for and handle.
- This might result in higher fault tolerance: if Order Service goes down, the Fulfillment Service can continue operating independently via its own copy of data.
- I suppose with this approach, you’d want to avoid allowing Fulfillment Service to modify product (each microservice would be the source of truth for its particular data).