Hello, I need to implement a rating system for all my catalogs.
To make this, I’ve decided to add a new player stat for each item.
For example :
if “player 1” and “player 2” both rate Item1 and Item2, 2 new player stats “Item1” and “Item2” will be added into their statistics.
With such information, I can retrieve the rate given by a player for a specific item.
Now, if I want to compute an average rate, I must:
1. parse all the catalog’s Items of any catalogs
2. find its associated leaderboard.
3. sum all the value for the item’s leaderboard and divide it by the number of leaderboard’s entries.
For example :
if “player 1” rate both Item1 ( 5 Stars) and item2 ( 3 Stars) and “player 2” rate both Item1 ( 3 Stars) and rate item2 ( 3 Stars), I now have 2 leaderboards.
Leaderboard item1 contains 2 entries so the average will be ((5 + 3)/2)=4
Leaderboard item2 contains also 2 entries so the average will be ((3 + 3)/2)=3
Currently, my strategy is to store those averages into the customData of each item and to run an admin tool which would update those averages (daily, for instance).
Would that strategy be able to handle a large number of players?
Do you recommend a better way to implement a rating system?
Thanks in advance