i’m building a system where users can earn XP-s. Those points are used in a leveling system.
I wonder, what is the best way of storing that. I use mysql but i think, mongodb can be a better way to do this task, so please help me, how can be done this work in mongodb.
Details:
- user can get xp-s for using the system (1xp/hour or 1xp/10minutes, doesn’t matter now)
- the time of last added point must be saved to avoid saving more points per hour (i can save this in session but there cane problems with this method)
- i don’t know, that it is necessary to save all the points in the db, or enough to increment a counter of xp-s.
I would track datetime, experience and reason. That way you can get better reports after.
When you want to get the total, all you have to do is get the sum for that player.
Also, you could track that this player got 1xp this hour for this reason