Best approach for storing/modifying item data
Working on a long term project that revolves around each item being unique drops. The stats roll on a certain range of values, each item has a tracking-id that is monitored in case of duping (unsure of all dupes in ruse), and sometimes they have unique perks. No two items are the same regardless of id, basically. I'm looking to improve performance and thinking of long term situations.
As of right now, the items equipped/in inventory are stored with the player's json save file (kept ruse saving). When it comes to banking, I divided the item's data into 4 different json files.
First, there's a json file that holds the map for the id (key) and hashes (value). When a player takes an item from their bank, it pulls one of the stored hashes then uses the stored hash to find the item's bonuses/item level/item perks. The other 3 categories (item bonus/item level/item perks) are stored in their own json files as well. When a player logs in, these files are loaded back into a map, and I search the maps for the data needed to assign back to the item it's taken out of the bank.
I'm worried about the long run in terms of how big the files become overtime. For example, if a player buys 100 of an item out of the store, I've tried placing this action on a task (using task manager) that loops through and creates each item, but it causes lag until the task is done. Fire Cape mentioned it's poor iteration and was wondering how do I improve it (it's a basic for loop code that creates 100x of the item & assigns a hash/item bonuses to it).
Also, is it recommended to continue storing the item's data into json files? Ran into an issue where the previous item's bonuses were lost. I'm unsure if this is a saving error or I need to double check for code that would the unique bonuses of the item.