Hello,
I'm trying to figure out what's the best way to achieve this behavior on playfab. Please take in consideration that we expect more than 500000 Daily Users on mobiles, so the performance of this request is a big deal for us.
The behavior I'm looking is a bit like tinder :
------------------------------------------------------------------------------------------------------------------
1) Player can publish a set of items from my game
2) Player can see a set published by any other player with at least one published set
3) Player can rate that set
4) Player can not be presented with a set he already voted
5) If a player publish a new set of item, the older one is erased and all rating is lost
-----------------------------------------------------------------------------------------------------------------
I tried to figure out how to do this system and this is my plan. Using SharedData, every time a user publish a set, I'ld add a Key-Value with key as PlayfabId of user who published the room and value a JsonDictionary with keys as PlayfabId of users who already rated this set.
In a CloudScript I would then use a GetSharedGroupData with empty array as Keys to get only members. From this list I get a random PlayFabId, then call again GetSharedGroupData with that specific id as unique Key.
At this point, I have the JsonDictionary where I can check if the authentified user as already rated this room or not. If not, I return the set. If yes, I get another random PlayFabId and so on until I find a set available.
This doesn't seems so optimal, and I'm scared to turn in very low performance on this script as the users rate other's. Also, if two users rate at the same time a set, I'm scared that the concurrent request override each other's, resulting in one of the rating to not be taken in account.Do you have any advice for me, or maybe a better idea on how to do this ?
Thanks a lot.