3 ms·
I could not find a description of the algorithm used for distributed transaction. I can only assume it's similar to CockroachDB but looking at the code I see a
by skyde 11y ago
I could not find a description of the algorithm used for distributed transaction. I can only assume it's similar to CockroachDB but looking at the code I see a lot of reference to "LOCK" in the protocol buffer definition which mean they might be using something else.
Anybody know where I can find more documentation ?
- hmottestad 11y agoSays they are using Raft: https://raft.github.io/ https://raft.github.io/
- rystsov 11y agoRaft is a replication protocol which is responsible for the consistency of multiple copies of the same data but it isn't applicable when the data is sharded.
- mtanski 11y agoYou can use raft as to synchronizing other data structures. If this a KV store then that's as easy as key level locks / ownership / placement.
- skyde 11y agoRaft is used to Replicate write in a shard but distributed transaction is used to make transaction that span several shard atomic (ACID). I could find the implementation at : https://github.com/pingcap/tikv/blob/master/src/storage/mvcc/txn.rs https://github.com/pingcap/tikv/blob/master/src/storage/mvcc... But a lot of the detail are not clear.
- c4pt0r 11y agoThe transaction model is similar to Google's Percolator, and with some performance improvements.
- skyde 11y agoThanks after seeing its based on themis code that is itself based on Percolator the distributed transaction logic make sense. Any idea how it compare to CockroachDB ?
- skyde 11y agoIn CockroachDB using SSI isolation if a Writer encounters a more recently read key the writer transaction restart. This guarantee that Write Skew cannot happen. In percolator design only allow for SI isolation unless lock are taken while reading.