We are building a sports APP where we have users of different kind (Athletes and Fans). Currently we are storing a ton of custom data fields in the UserProfile (Name, Age, DOB, City, School, Grades, Sports and more .. ).. We want users to be able to search the entire database using custom query of these fields .. Lets say (Show me all the users in the APP, that splay Baseball, and are in NYC and have been active for last 1 week)..
I understand that PlayFab is not designed for this, but wondering what is the best way to design and architect a solution for this? We are mainly using PlayFab for Auth now, but we have a need for leaderboards, economy and more in the future. But storing data is PlayerTitleData is not going to help us achieve what we really want.
One of the solutions we are looking into is to save the data into CosmosDB and use custom cloud scripts to talk to CosmosDB and return the responses to the client, that way the client can only talk to PlayFab and not have to worry about connecting to CosmosDB, and also helps us secure the Data?
Answer by Citrus Yan · Nov 20, 2020 at 09:47 AM
In your case, yes, you’d need to use an external data store solution, such as CosmosDB you mentioned in question. And yes, CloudScript can serve as a secure proxy between the clients and your database, for that I’d suggest that you use the new PlayFab CloudScript using Azure Functions feature, which introduces few key improvements compared to the old CloudScript feature. Please let me know if you have any further questions.