I'm still not super familiar with PlayFab best practices and am wondering on this case what would be a good general idea.
I want to store a list of Steam generated keys privately and reward them to players as they meet certain conditions, such as spending in game currency that has a controlled reward structure.
So I need to store them in 2 places and use CloudScript to grant the selected reward if there are enough left.
When players go to redemption page they should be able to see how many keys are left of a specific title.
They keys need to be able to be associated with a title both in the global storage and in the player storage. I'd need to manually replenish them.
Players should be able to see a list of keys granted to them, when it was granted, and the title it is for. So that all needs to be stored.
Would something like this be reasonable to do with only PlayFab features / which features would I want to use specifically?
Using private Title data / read only player data seems easy enough, but I worry about being able to guarantee an individual key can only be granted to one person. Are cloud scripts ran in order or is there possible for two to edit a title data at the same time?
There is also this "Title Data must never be updated as a result of a client action" so it seems like I have no choice but to use a 3rd party service for getting keys for users when they are granted. Not a big problem but I'd like to use PlayFab 100% if it is possible.
Instead of granting keys immediately, I think I could use a Scheduled Task / Bulk Action to go through users and grant keys as they are available for those who were able to request them, but this not being immediate seems like it would be less satisfying. I think I could use limited quantity items as a proxy so that there will likely never be an overredemption of keys.