2

Let's say that I want to develop a Dapp and I need to store different information about the users. This information must not be public as not all the users are allowed to see all the information stored. Is using a centralized database a bad solution? Should the Dapp owner run the servers with the DB to make sure no one can have access to all the data stored?

What are some completely decentralized ways to solve this problem?

1

I was having the same question three months before. I have used IPFS-Store for the development of PoC. The advantage of using IPFS-Store is querying functionality provided by it using elastic search.

0

I would say Yes.

While the ideal DAPP probably looks something like this :

a) Ipfs for storage (Decentralized file system)

b) Smart Contracts on ethereum (Decentralized smart contracts)

c) BigChainDB as Database (Decentralized database)

The reality is that there are a number of unknowns in this architecture (For instance -oracles for communication from BigChainDB to Ethereum). A typical DAPP as of March 2018, is not completely decentralized.

Hence,the database component is a more conventional database (NoSql or Sql), and the smart contracts mostly store primary keys of only part of the database schema. Storage on Ethereum public network is very, very expensive (order of 1000's USD/Mb)

The cost factor has driven people to look into a "multi chain" architecture for cheaper storage, and has made private Ethereum far more appealing.

0

As I already wrote in your related question "Where do you save the application data of a Dapp?", you can reach decentralisation if every user is running his own DB containing his own data and an instance of a service-facade managing the access to this data. On-chain you can manage permissions, relations, and data fingerprints. The service-facade is connected to the blockchain for checking user authorisations. The DAPP is connected to the blockchain and is also able to aggregate data from different private user databases. Moreover, DAPP can be served via IPFS.

  • decentralised data storage -> every user keeps his own data
  • decentralised data access -> every user manages the access to his data
  • decentralised DAPP hosting via IPFS
  • decentralised permission/relation management via blockchain

In any case, it's not a good idea to let the DAPP owner manage all the data in a centralised DB. It would be contradictory to the concept of a DAPP.

The question if you should use SQL or NoSQL database, depends on the usecase and is actually not relevant for the aspect of decentralisation.

0

One option is to encrypt the data and send it to the smart contract. The data would be decrypted/encrypted only outside the blockchain. Disadvantages are:

  • The smart contract can't read the data as it can't decrypt it
  • Requires even more storage space within the blockchain (costs more)

If this is ok for you, then you can also save in storage costs by storing the data in logs instead of contract state. Logs can't be read in contracts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.