4 ms·
This is not true, and not YOLO, either. You have four separate businesses (at least): a bank, an airline, a hotel, and booking agency. There's no way that som
by numbsafari 3y ago
This is not true, and not YOLO, either.
You have four separate businesses (at least): a bank, an airline, a hotel, and booking agency.
There's no way that some random booking agency is getting an XA transaction (or other distributed transaction protocol) implemented between the disparate systems it is orchestrating.
It has to maintain conversational state with each of those systems in the domain/model of the exposed APIs of each in order to coordinate a resolution. Even if you could do that with an distributed transaction coordinated between those disparate entities, the possible failure states of each are such that you likely wouldn't want to. For example: go ahead and book the flight and pay for it if you can, but don't rollback the whole thing if the hotel ends up needing to decline for some reason.
These business models exist today as real world systems, and they aren't implemented using distributed transactions.
- paulddraper 3y agoThose are in the abstract and literal sense, distributed transactions.
- yathaid 3y agoTell me you are implementing distributed transactions without telling me you are using distributed transactions! :)
- silon42 3y agoThis what basically what a Saga is... a process that uses custom protocols to resolve the state of multiple entities to a consistent valid state. Sure, avoid Sagas when possible (use a DB transaction if you can merge microservices), but when you aren't setting system boundaries (aka your world isn't a single system supporting XA everwhere), the Saga is a completely valid and necessary mechanism.