In this case, I am trying to cache a bunch of calculated basketball stats (Assists, Shooting percentage, etc.). For simplicity sake, assume we are just caching season-wide stats (I'll do other calculations but they will follow this same procedure).
Which storage type should I use for this? I basically need a table like this (https://ibb.co/M7cZ2vt) to be re-creatable from whatever I do. I don't really want to do JSON (personal preference) but if there is a case for why that is best, I'm up for it.
Should I maybe store as an array? Let me know what you think.
The format you store it in doesn't really matter since it's in your cache anyway. Use whatever you prefer.
For me personally I like to store DTO's or ValueObjects. This way you know exactly what kind of object you get back from the cache. If you store just an array you also have to validate if certain keys exists and so on.