1

Is it a good practice to store millions of values in a mapping variable for unique verification? For example, storing a customer name and unique number and later retrieve customer information from that unique number (like a sequence number).

1 Answer 1

2

Well, that's exactly what the standard ERC20 does. It stores all the balances, aka the people who own the token, in one mapping variable. This is actually a revealing fact for many people. When you send someone the tokens you own, fundamentally, only some values of an array are updated.

Therefore, it is safe for you to store your customers in a mapping. However, due to collisions, I wouldn't make the name the key. You could try a username.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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