views:

16

answers:

2

I've heard a couple months ago that Amazon was inclined to change all of its transactional shipping code (which also has another problem, they are distributed aka "sharded") into non transactional code.

some_buy_method()

  check_item_stock()

  remove_item_from_stock()

  add_to_order()

end
+2  A: 

First answer: With difficulty.

Second answer: With potentially disastrous results.

I doubt Amazon wants to eliminate all transactions. What they probably want to do is relax the ACID conditions to improve scalability and availability: they're still going to want atomicity and durability, but will have to refactor their operations for commutativity and idempotence and add compensating transactions to deal with reduced consistency and isolation.

Pontus Gagge
+1 for the interesting link about a new definition of ACID
ewernli
+1  A: 

I heard that eBay also was running without transactions, maybe Amazon will follow a similar approach.

From The eBay Architecture (slide 18, 23):

Absolutely no client side transactions

How do we pull it off?

– Careful ordering of DB operations
– Recovery through
• Asynchronous recovery events
• Reconciliation batch • Failover to async flow

Rationale

– Avoid deadlocks
– Avoid coupling availability
– Update concurrency – Seamless handling of splits eBay

(Sorry for the formatting)

To me, it looks like if there are not ACID transaction, you need to check, recover or compensate thing manually. But the exact business logic is known, so a proper error handling or conflict strategy can be devised. That also makes me thing of error handling in BPEL where things are asynchronous and we write compensation handler.

ewernli