lxzhu
Re:Transactions in a Microservice World
on Tuesday August 22, 2023 @06:37PM (#37229506)
I kind of feel it depends on what does "transaction" mean to you. In a multiple steps business flow, one can say each step is a transaction, but people also treat the whole flow as a transaction.
For example, a user buys a product online and pays by her bank card. It could be implemented as following steps: 1. sales services request inventory service to reserve a product for this user. 2. sales service request payment service to debit user's card. Is reserving a product a transaction by itself? Or is it just a step of a bigger transaction of buying? If you take the former, then cancelling resevation would be another transaction. If you take the later, then cancelling reservation is a part of transaction rolling back.