Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merkle tree for difference comparison, in Cassandra

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?

like image 550
snowmantw Avatar asked Jun 28 '17 06:06

snowmantw


People also ask

What is Merkle tree in Cassandra?

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 can we use a Merkle tree for?

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.

How do you verify data on Merkle tree?

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.

How do Merkle tree work explain with example?

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.


1 Answers

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.

like image 155
nevsv Avatar answered Nov 15 '22 03:11

nevsv