0

I agree that the smart contract works well for small Apps. Is it ok to develop a app with huge data. For this let us take an example of building a huge patient database across hospitals (only with key values, and the images will be saved in IPFS/SWARM). The patient database will grow and grow and grow. Will the ethereum Smart contract for this app able to serve the purpose with such a large amount of data in smart contract ?

What should be the best way to approach this ? Please advice

1

The network itself won't have problems with the data and gas usage won't be a big problem if you're only storing the hashes.

All data on the network is readable for free (without gas) from a full node. Read operations are not sent to the network at all but they are all completed on the node you use. Therefore performing lots of read operations will not be a problem for you. You can read more about this here: If view or pure function doesn't cost any gas, would they be abused/free ride?

Also contract storage "limits" won't be an issue as contracts have basically unlimited storage size. More about this here: Is there a (theoretical) limit for amount of data that a contract can store?

Therefore I don't think you will have any issues with your approach.

For practical purposes, you should of course think in advance about how you want to access your data. If you store data for example in a mapping, you won't be able to iterate over the mapping data. If you need to iterate over the data, you need to store data in a different format, such as arrays.

| improve this answer | |
  • Will there be any significant delay when we have 10M data in an array ? – iappmaker Dec 28 '18 at 12:10
  • 1
    If you mean when reading the data, then it has nothing to do with the blockchain. So whatever delay there is is caused by your node and your server which reads the data. However, I can't tell how well the node client performs with lots of data as I have no idea. – Lauri Peltonen Dec 28 '18 at 12:20
  • I am happy with your answer.. but I would require the effect on data retrieval as well – iappmaker Dec 28 '18 at 12:26

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.