2 ms·
Not all things which can be idempotent are, but not all things can be idempotent. You can't un-print that letter you wrote on the page. You can't un-read the wo
by ggm 2y ago
Not all things which can be idempotent are, but not all things can be idempotent. You can't un-print that letter you wrote on the page. You can't un-read the word cabbage, or un-think about cabbages now you've seen it. You can be asked to think or not think about cabbages again, and arguably thats idempotent to non-effectiveness but it has OTHER consequences: Time passes. Your anger raises. Even reading this comment causes changes in the real world.
I like the article, and I like the idea of writing distributed systems to enforce idempotency when it's possible, but you need to understand sometimes it simply won't work.
If you spend those specific dollars with a [buy now] button, you can't prevent the transaction happening behind the scenes and spend them again. Well.. you might think you can, but the real world consequences of spending the same dollar twice will come out eventually. So, from this crude analogy, shopping cart events have qualities which can be pretty damn hard to make fully idempotent.
"amazon regrets it is unable to fulfill your order" lies deep in a machine which displayed "only one left in stock" to 100 people, just as one of them clicked "buy now"