When do you start thinking about compensating transactions?
Zhen Liu
·505 views
I'm really interested in how everyone else handles compensating transactions in their distributed systems. We've got more and more services now, and sure, eventual consistency works for a lot of stuff. But then there are some workflows where if one step bombs, we absolutely have to undo or fix previous steps. Like, imagine a multi-step order: stock gets reserved, payment goes through, then shipping starts. If shipping fails, yikes, we need to un-reserve that stock and maybe even refund the payment.So, when do you guys usually start thinking about compensating transactions in your designs? Is it a day one thing for crucial paths, or does it pop up when specific problems show up and you need rollback logic? And are there particular kinds of transactions or areas where this is a total must, not just a 'that would be nice' feature?
11 comments