Best way to store in game statistics?

I’m creating a 1v1s ranked gamemode for my small community like game and I want to store statistics for which powers are strong or not by storing the wins and losses acquired for each power. This would help me find popularity of certain powers and whether it’s weak or not.

I’m not sure what kind of method I should use to store this information. I already tried experimenting with datastore but i’m afraid that since each match is in their own zone it might erase new data when trying to add the new loss or wins value.

I tried looking online for someone with a similar situation but all the forums/posts show is how people should store data of players in general. I thought of using storage system like MemoryStore but that might be too much to hold a month’s worth of data of powers and their win/loss rate.

Any methods recommended would be appreciated.

MemoryStore won’t be a good choice because the data it saves is not permanent. I am not too familiar with the ins and outs of using DataStore, so I couldn’t give you an exact solution, but that is the option you would probably use.

Typically, a player would save their data using their own individual key. However, for this situation, I would imagine you could just make your own key. Then, every time a player wins or loses with a certain power, you just add a win or loss to that datastore, under whichever power it is through a table.

That’s what I was thinking, but the issue is with de sync across multiple 1v1 matches where one server will have data from that second and overwrite any other data that was just put in.

If you pull the data at the start of the match, the duration of the match creates a longer window for overlaps to happen. However, if you pull the data right as the match ends, update it, and then immediately save it, I think that should be fine. I could be wrong though.

Also found this in the documentation that could be useful:

UpdateAsync() is safer for handling multi-server attempts because it reads the current key value from the server that last updated it before making any changes. However, it’s somewhat slower because it reads before it writes, and it also counts against both the read and write limit.

Let me know how it goes if you make any progress, I am still learning and this seems useful to know and may be something that I will use in the future!