Many People Want To Know When Blockchain Data Is Stored On The Chain.

admin 79 0

Many people want to know when blockchain data is stored on the chain and when it is stored in the database of the corresponding node? Today we will solve this interesting problem! ! !

First we need to clearly understand two concepts:

Blockchain data; On-chain data; First of all: Blockchain data includes block data and status data. Block data actually describes the record of every transaction that occurs on the blockchain (such as the transaction from Xiaoshuai to Xiaowang). Transfer 50 yuan, Xiaoshuai recharge 20 yuan, etc.) and status data record the current status of each account and smart contract (for example, Xiaoshuai’s balance is 200 yuan, Xiaowang’s balance is 20 yuan)

Both block data and state data are used and stored by our blockchain nodes. Blockchain Node is a program that allows multiple nodes to be stored on our computers, virtual machines, etc. over the network. These links eventually form a complete blockchain network.

Among them, the most common way to store data on a blockchain node is to store it on our disk. Our blockchain does not access our disk directly, but independently through a specific database (e.g. MySQL). Use distributed databases to operate our data (the most important technology currently is to add cache areas to reduce disk seek time and speed up the use and storage of disk data in the blockchain). Compared with direct access to disk, a specific data access model mediated by a database is more friendly to blockchain nodes.

Then the process of data storage can be explained as

Databases are divided into independent and embedded: the biggest difference is whether independent deployment is required. The embedded database and blockchain nodes are integrated in the same process, moving and stopping at the same time, and there is basically no sense of independent existence.

Second: data on the chain

Note: On-chain data is data generated directly or indirectly by blockchain consensus;

1. Back to our question, we will find that the block data and status data in the middle of the blockchain are not generated out of thin air. The data in the middle of the block is because the transaction data between different nodes is stored and then broadcast to the consensus status of all blockchain nodes, so the block data is also one of the data generated due to consensus;

2. Looking back at the status data, due to the generation of transactions and the reaching of consensus, the status will eventually change, so from this perspective, the status data can also be considered as on-chain data;

Summary: So back to the original question, blockchain data can be regarded as the data generated by consensus transactions and is part of the data on the chain!

Therefore, the issue of on-chain data storage and database storage is not valid, because on-chain data and database are not concepts at the same level. All data stored in the consensus-generated database can be called on-chain data!

标签: #Big data #database

  • 评论列表

留言评论