Introduction to How Data is Stored on Blockchains
For background, let’s go through data storage as a whole. So, blockchains need to store data like transaction records for transparency and trust issues. One important term to know is the persistence mechanism, which is essentially a mechanism to store the data forever. Moreover, the data is generally stored on all the nodes because all the nodes must agree on a common blockchain. Therefore, storing this data is quite important, and finding an efficient way to store all this data is even more important.
Simply storing this data on all the nodes may seem like the most secure method, but it is also very hard, as many blockchains have terabytes of data. Storing all this data could be extremely taxing on the nodes. Ethereum for example, has more than 1 TB worth of data stored, but as this number continues to grow, it could become impossible to store all this data on the nodes. Not to mention that the cost of uploading this data to the blockchain mainnet would be extremely expensive. With this, let’s get into two major ways to store data on blockchains:
Blockchain-Based: A blockchain-based data storage mechanism simply stores all the data on the nodes. Ethereum and Arweave are both blockchains that use a blockchain-based data storage mechanism. To go into greater detail, the mechanism works by updating the whole chain when new data is introduced. When this data is introduced, it is placed into a block at the end of the chain, where more data is added and the chain grows. In this system, all the data must be stored on every node. With Ethereum having more than 1 TB, all the nodes must have this 1 TB of data stored. There is a cost involved with storing all this data, and to counter that, an incentive mechanism is created. For blockchain-based storage, this incentive mechanism involves a payment to the validator who uploads data to the blockchain/when data is added to the chain.
Contract-Based: Given that blockchain-based storage is extremely taxing on the nodes involved in the blockchain, contract-based storage offers a method that reduces the weight of the nodes. In this mechanism, a series of contract agreements help to ensure that data is stored. How it works is simple. A contract is made with certain nodes to hold all the data for a certain period of time. Once the contract runs out, another contract must be made to ensure that the data is stored. The nodes that store the data are paid/rewarded for storing the data. Moreover, a hash on the mainnet is created to help locate where the data is stored. With this method, all the nodes don’t have to store the data; only a few do. Thus, the data is stored more efficiently, although there are a few security risks involved with storing it only on certain nodes.
If you want to learn more, check out the links below:
Thank You for Reading
If you like this article, consider reading my other articles