One question im struggling with is how to make linear, cross-service operations/transactions in a distributed system.
For example, I have two services: Orders and Payments. How would the Orders service call Payments, while not allowing intra-service coupling?
As I understand the Orders service would emit an event like requestPayment
for a user and a sum, and the Payments service would react to that, process the payment and then emit something like paymentUpdated
with a new status on the payment. Is this correct? Isn't this a coupling in disguise, because the events are so closely tied together?
Assuming this is the way to go, how would it look from an API consumer perspective? Would this all happen while the request was hanging?
I am not interested in Event Sourcing at this point.