To understand the performance of my games, I want to start tracking data. The first thing that I want to do is I want to track which map the player leaves on. I could do this with a player removed event and increase the value of the map by 1.
I want to have an entire list of the maps and the amount of times they have been left in total (all players combined). I don’t have too much experience with datastores. The only thing I know how to do is save data for the player and not the game.
Saving game data is the same process as saving player data. The only differences are you may want to use IncrementAsync instead of SetAsync or UpdateAsync as well as your key would be something like “MapLeaveData” instead of Player.Name or Player.UserId.
This is not scalable for DataStores and this is not what DataStores were built to do. You need to look into a third party analytics service such as GameAnalytics or GoogleAnalytics.
Each data store is like a bank teller, you tell it individual transactions to do on the data, and it reliably performs them, giving you an updated, consistent state that the data store is now in.
This model does not work for tracking game statistics. If you are running a large game, there could be hundreds or even thousands of analytics events pouring in every second from all across the world. Given that information takes time to travel around, there is no single “current number of visits” or other such statistics. Precisely what the value is will depend on where you’re asking from.
What you need for statistics tracking is a “funnel”, which all of the analytics events pour into, and you eventually get a total tally of those events out the other end. This is an entirely different use case than what the data stores support, so you can’t use them for that.