Closed abolfazlmohammadiseif closed 4 years ago
Hi @abolfazlmohammadiseif, that's an interesting question!
It's hard to answer that question in general, because, as usual, it all depends on the context.
But, in general, I'd say that looks a lot like a distributed transaction, and a candidate for Two Phase Commit. If that's the case, then it's probably not a good idea to have those DB in separate microservices, because the compensatory actions for such scenario could get quite complicated.
You might find the following sections from the Microservices Architecure guide interesting for this topic:
Hope this helps.
Closing this issue now but feel free to comment, will reopen if needed.
Closing this issue now but feel free to comment, will reopen if needed. Thank you very much. I'm working on your suggestions.
Hi I have multiple microservices. I update a record within microservice A then send an event to microservice B and do another update in microservice B. if the second update fails, I need the first one to be roll-backed. how should I handle such a transaction? Thanks in advance