Solidity – Can a Smart Contract Be Used as a CURD Database on Blockchain?

blockchaincontract-developmentdatabasepolygonsolidity

I am a full stack enginer. I am going to develop a decentralized social app. Fully not have backend.

My choises:

  • Frontend: react or vue.
  • Big content storage: arweave.
  • Cheaper and faster chain: polygon.
  • Authentication: smart contract.
  • CURD database: ?

There are flexible and large amounts of data, such as likes, comments, reports, and mappings of content in arweave.

Can there data be stored in smart contact using list or mapping type?

Because there will be millions of data. I can't imagine there data just be stored in List or Mapping variable.

And how to do search work in there data, Gas fee will be huge.

My english is not good, hope you understand what I mean and thanks for your answer.

Best Answer

You could store that on a blockchain. And if you use mapping in a smart way, accessing the data, and even editing it shouldn't be that expensive. But the sheer amount of data (Millions of users) will likely make it too expensive for you yourself to cover the day-to-day cost of operating everything. However, if individual users are paying their own price, it might have some utility.

But in general, you should try and write as little data as you can into the blockchain, because it's expensive.