Retrieving snapshots of game statistics
- by SatheeshJM
What is a good architecture for storing game statistics, so that I can retrieve snapshots of it at various moments?
Say I have a game, and the user's statistics initially are:
{
hours_played = 0,
games_played = 0,
no_of_times_killed = 0,
}
When the user purchases something for the first time from within the game, the stats are
{
hours_played = 10,
games_played = 2,
no_of_times_killed = 5,
}
And when he purchases something for the second time, the stats are
{
hours_played = 20,
games_played = 4,
no_of_times_killed = 10,
}
Let me name the events as "purchase1" and "purchase2"
How do I model my statistics, so that at any point in the future, I will be able to retrieve the snapshot of the statistics at the time when "purchase1" was fired.
Similarly for "purchase2" and any other event I will add.
Hope that made sense..