Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by syntern on Friday May 30, 2014 @04:57PM
(#7824031)
You can always save the fact that a transaction was started, read the account's state (including the most recent transactions as an ordered list), calculate the validity of the item, and update the success/failure accordingly.
It is not the transaction itself that is hard, it is the network partition. E.g. what happens if two network partition approve transactions, that wouldn't have been accepted if there were no partitions.
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by rch on Friday May 30, 2014 @05:11PM
(#7824115)
I've probably gotten off base here by wanting to perform arbitrary actions against services I may or may not control in the course of satisfying a command, and worrying too much about made up corner cases.
If this DB is the sole record of The Money, and I can move some quantity from X to Y in a transaction, then that's fine by me.
Financial transactions are pretty much the poster child for atomic, multi update transactions and pessimistic locking.