I'm reading an document about repair in Cassandra, it says
The comparison begins with the top node of the Merkle tree. If no difference is detected, the process proceeds to the left child node and compares and then the right child node.
However, Merkle tree's non-leaf nodes represents:
Each Parent node higher in the tree is a hash of its respective children. Because higher nodes in the Merkle tree represent data further down the tree, Casandra can check each branch independently without requiring the coordinator node to download the entire data set.
According to this, and other data structure articles I have found, they all indicates a following comparison deeper than the root only be proceed if two Merkle trees has the root that differs. I'm not sure if the document describes it correctly that I may understood something wrong, or it actually has an error?
Merkle trees are binary hash trees whose leaves are hashes of the individual key values. The leaf of a Cassandra Merkle tree is the hash of a row value. Each Parent node higher in the tree is a hash of its respective children.
What Is a Merkle Tree? Merkle trees, also known as Binary hash trees, are a prevalent sort of data structure in computer science. In bitcoin and other cryptocurrencies, they're used to encrypt blockchain data more efficiently and securely.
In the case of the Merkle tree, you can download the branch and then use it to verify the transactions. There is no need to download the whole tree to verify transactions. This also means that the whole tree can be divided into small data blocks which can be used to verify transactions all across the network.
A Merkle tree stores all the transactions in a block by producing a digital fingerprint of the entire set of transactions. It allows the user to verify whether a transaction can be included in a block or not. Merkle trees are created by repeatedly calculating hashing pairs of nodes until there is only one hash left.
There is a mistake in Datastax docs.
There's is a good explanation of Merkle tree's comparison:
http://distributeddatastore.blogspot.co.il/2013/07/cassandra-using-merkle-trees-to-detect.html
Many eventual consistency databases using Merkle tree for anti-entropy. You can review the documentation and explanation of it in Riak/DynamoDB documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With