Is there any scalability problem if the number of items of a solidity mapping increase too much? For example, any problem when adding, changing or removing some item in the dataset? Or any other problem? I know the key is calculated using hashes, which minimizes a lot of these kinds of issues, but I want to check if any issue will always be possible with extreme volumes.


No issue.

It is economically, not technically constrained. You might say the market runs out of money before the EVM runs out of space. You can write as much data as you and your users can afford. Someone pays for the gas to do it. The insert, overwrite, and delete costs within a mapping are scale-invariant.

There are some non-obvious, possible effects at the extremes. For example, chain-bloat would make the overall state larger for everyone. If your users have sufficient capital to create that problem then it would be conceivable that SSTORE could be repriced (against you) in a hard fork to discourage large-scale use of your dapp if it is seen as causing an undesirable effect to the network overall. In thinking about such possibilities, you can see we're at the edges.

Hope it helps.

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.