Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by maaku on Friday May 30, 2014 @03:11PM
(#7823436)
Fully ACID transactions is a big deal.
[ Parent
| on HN ]
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by dgrnbrg on Friday May 30, 2014 @03:16PM
(#7823463)
They're based on Raft--that's not a consensus protocol that's designed for multi-datacenter operations. I suspect you'll have reliability and throughput issues fairly quickly, just as you see with multi-datacenter zookeeper.
The solution Google uses for this kind of problem: multidatacenter transactions are rare, so they're not optimized for latency (instead for reliability), and they tend to use 2PC, as it's easier to get right with unpredictable WAN latencies.
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by rch on Friday May 30, 2014 @03:33PM
(#7823545)
Riak will have strongly consistent buckets in 2.0+, which pretty much takes care of the cases in which I'd need guarantees for data in this storage model.
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by maaku on Friday May 30, 2014 @03:38PM
(#7823568)
Consistency of single updates is vastly different than multi-write atomic transactions. The former precludes, for example, financial applications which require atomic updates of multiple balances.
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by rch on Friday May 30, 2014 @04:00PM
(#7823687)
Clearly, but I would just be using Riak to store the single command that indicates an update of multiple balances should be scheduled. Given sound guarantees at that level, I'll be able to implement the transaction myself in any number of ways, inclusive of interop with external services.
Re:CockroachDB: A Scalable, Geo-Replicated, Transactional Da...
by stuki on Friday May 30, 2014 @04:36PM
(#7823917)
And if two commands get stored in quick succession, such that the first results in a state that renders the second impossible? Particularly if some of the balance updates in the first command, are contingent on others ( credit line backing checking account updated if deposit balance < 0, for example )?
Financial transactions are pretty much the poster child for atomic, multi update transactions and pessimistic locking.
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.