Storing data in web3

Web3 applications are decentralised and built on the blockchain. We'll look at how these applications store data.

Web2 applications store data on services like AWS or Azure. These services are centralised - the application (e.g. Twitter) and service provider (e.g. AWS) have access and control over the data. What does the equivalent look like in the web3 world?

Let's find out.

Decentralisation

A data solution for web3 should be decentralised. At a minimum, no central authority can have control over data. Ideally, the solution is also community owned and operated.

Storing data on the blockchain is not always viable

Storing large amounts of data on the blockchain is prohibitively expensive.

All actions on the blockchain incur a transaction fee. Some data, like transactions, has to be stored on the blockchain. But for other data (e.g. metadata for an NFT), you're better off storing it off-chain.

Peer-to-peer (P2P) databases

Decentralised peer-to-peer databases can be used to store data off-chain.

They distribute data across different nodes and maintain the principle of decentralisation. These solutions are analogous to services like MongoDB or Snowflake in web2 applications.

Examples of P2P databases: Ceramic network, OrbitDB and Textile.

File storage

dApps need to store files like pictures, videos or PDFs.

These are best stored on services like IPFS (Interplanetary file system). It breaks your file into chunks and stores it across different nodes. There are other solutions that operate independently (Airweave), or on top of IPFS (web3.storage).

Closing

If you're building a dApp, use a decentralised data solution. Otherwise, you're trading away decentralisation to your database provider.