mappingethereumsoliditycost-management

How much would be too much data to save in a public mapping?


So I know that in solidity for larger data we wouldn't use contract to save the data but rather we'd use some kind of external database. But I'm not sure how large is too large and what would happen if we do save large amount of data just for the sake of user view.

So for for example a mapping mapping(uint256 => uint256) public Vals with a thousand uint256 values. would that be too much of data to save just for users view? How should i know if it actually is too much data or not?

Saving a 10k long mapping values just for the sake of users view.


Solution

  • You can save as much data as you want, but you should know it's exorbitantly expensive.

    Quick breakdown:

    Want to explore cheaper networks? Check out: CryptoNeur's Gas Fees Calculator.

    Finally, consider storing big data on IPFS and storing the IPFS path on the blockchain.