3 ms·
Fun article, but the title is a little misleading. It's not that Starbucks doesn't use 2-phase commit. It's that they break their sales process into a couple of
by abalone 13y ago
Fun article, but the title is a little misleading. It's not that Starbucks doesn't use 2-phase commit. It's that they break their sales process into a couple of atomic transactions that run in parallel: payment and delivery. Each of those steps still in fact uses 2-phase commit.
Running a credit card or accepting cash is 2-phase commit. Drink pickup could be seen as a 2-phase commit (put drink on counter, confirm name, take back if name doesn't match). What's interesting is the exception handling logic between these parallel transactions. I.e. if payment fails while drink is getting made, try to cancel the drink delivery.
So the issue here is not "atomic or nonatomic", it's "how do I break a business process down into a set of atomic transactions". Very few businesses are going to run their entire supplier-to-customer process inside of a single atomic transaction.