question

will-1 avatar image
will-1 asked

Get bulk Player Data

Hi. I am wondering if I can get some help with retrieving PlayerData in bulk. I have read a few other similar questions and each of them seems to have the same answer: that PlayFab does not have any APIs which can get PlayerData in bulk.

While I understand this limitation, I'm sure this isn't an uncommon use case. Fetching extra data alongside a leaderboard, within Entity Groups, friend lists etc. If this can't be achieved through PlayFab's API, are there any suggestions on how else this might be achieved?

I saw one user mention that a redis cache could be used for example. I wondering if there are any other strategies people have used to get around this. I tried using GetProfiles, but that only seems to return legacy data (rather than PlayerData).

Thanks!

apisPlayer Datadata
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

GetProfiles retrieve entity data, which in face, is the newer data model. This API can return Entity Objects, whose usage is like Player Data. For now, you still need to iteratively call APIs to get Player Data and there is an upper bound of 100 calls per 2 minutes for client API. As long as the frequency doesn't exceed, it should work fine. Adding a paging feature in your project also helps.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

will-1 avatar image will-1 commented ·

At the moment the Entity Objects are too limiting (size-wise) for our use case. We very quickly ran out of space with only 5 x 1000 bytes. We also tried using the Entity file storage but it was quite unreliable for the amount of reading and writing we were doing.

Out of interest, is the 100 calls per 2 minutes per client, or for the entire project? It's possible we could build our own system that staggers requests within that limit if it's per client. If that's the suggested approach then that might be required.

Are there any plans to be able to get Player Data in bulk, or is that no longer supported in favour of the new Entity Objects/Files?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ will-1 commented ·

Client API limit is 100 calls per 2 minutes per IP. If you have a self-hosted long-time-running server, you can use server API to iterate the list. The limit for server API is 1,000 calls per 10 seconds. For most of the time, it is not a compulsory task for a game (especially, one is near time, using RESTful API for data transmission) to get a bunch of data in time. If you can share your design scenario, I can dig into it and provide more practical suggestions.

>>Are there any plans to be able to get Player Data in bulk

There is no information about it, but it is always welcome to submit a thread on the Feature Request forum or upvoting an existing one.

0 Likes 0 ·
will-1 avatar image will-1 Seth Du ♦ commented ·

We have a few pieces of data that we're currently storing in PlayerData, such as win/loss results, rank, top score etc that we generally show alongside player names on leaderboards, or in friend lists. We want to be able to fetch these in bulk rather than require a user to select a particular player to see their stats.

I believe I read a recommendation somewhere that you can store these in Statistics and fetch those in bulk, but in my case that requires a bit of double handling of data. For the example of the wins and losses, we have a ledger of battle results for each player, with data about who won, how long the game took etc. We use this currently to determine a player's total wins and losses. If we use statistics as well we will also need to track their raw wins/losses as integers, which leads to multiple sources of truth if the ledger and the statistic get out of sync.

It's probably not the end of the world to move everything we want to track in bulk to Statistics, but I was hoping that there could be a cleaner solution.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.