I looked at the data. Why are you thinking about storing data in a database? I suppose you want to read the data, run some algorithm on it and calculate the result, right? Or is it really a requirement to store data on an ongoing basis, or is that even all you are trying to do?
You have a list of all that look like this:
[KillsByEnemyTypeClass] => Array ( [0] => stdClass Object ( [Key] => 0 [Value] => 0 ) ... [MedalCountsByType] => Array ( [0] => stdClass Object ( [Key] => 0 [Value] => 0 )
As follows from the data format, lists are sequential arrays, not pairs of key values. Since the keys are all sequential, you can save the values in one large array in your programming language.
This is your data format:
struct Data { std::string reason; int status; struct AiStatistics { int aDeathsByDamageType[82]; int nHopperId; int aKillsByDamageType[82]; int nMapId; double fMedalChestCompletionPercentage; int aMedalCountsByType[128]; int nTotalMedals; int nVariantClass; ... } aaistatistics[9]; }
It seems that arrays should have a static size, because 82 different types of damage probably mean something to you. If there are 83 types of damage, the program that generates this data will change, and you will also have to adapt your algorithms. This means that the data and your program are not independent, and the benefits of using a database are doubtful.
Update
Thanks for clarifying your requirements. I understand why you should now cache data for other clients.
But: is the data related to the data you have to store? Does this mean that you only cache the output from the web API, and if as a result of the change you overwrite the previously saved data? Or is there a temporary dimension and you want to keep the sequence of API outputs? In both cases, a thin C ++ API around binary data can be much more efficient than a database.
If it's just for caching data, I would still suggest modeling the database after the above object model. The AI statistics table has one column per member variable, i.e. One column for the full array of DeathsByDamageType. Store the entire array as a single value. Clients cannot search for a single value using this model, but must receive a full array. If you do not have a specific use case for anything else, I would stick to this. Your database will be much simpler.
If this is really, really, really not enough for your purposes, your tables are likely to be:
table Data { id, reason, status } table AiStatistics { id, data_id, ..., all integer members like nTotalMedals etc } table DeathByDamageType { aistat_type, index, value } table ... for every other array member of AiStatistics
By default, storing DeathByDamageType in this way is really inefficient, the table is at least three times larger than the array value, because for each value you need to store the AiStatistics reference identifier and array index separately.
If you do this like that, at least use sparseness in arrays and don't store values in DeathByDamageType that are 0. You could not do this with an array.