question

Jon avatar image
Jon asked

Player Data Format

Hi, I am evaluating the use of playfab and have a question regarding storage of player data.

The docs suggest the use of entities for new titles but the usage limitations for it are confusing to me.


Entities: 5 json objects of 1,000b size

Key Value: 1,000,000 bytes for k/v pairs

I saw entity files as well, but we are not storing huge amounts of data.


1,000b is not a small amount but also not a huge amount either. We want to store the following data:

SaveGUID Unique id to identify the save
GameVersion Latest version of the app used to save the game
PlayerXP The amount of xp the player has for the current level
PlayerLevel The current player level
Hero Levels [hero_id][hero_level] map
If hero_level is 0, that hero is not unlocked
World Progress [world_id][max_level_completed] map
Indicates what levels are completed on each world
Talent Levels [talent_id][talent_level] map
If talent_level is 0, that talent is not unlocked

Certain things like SaveGUID / GameVersion / PlayerXp, PlayerLevel seem to be more efficient to store as a simple key/value pair.

The maps would be ideally stored as json (as to be human readable) but if the limit per blob is 1000b then it makes me pretty cautious to store it that way. For example:

{
  "WorldProgress": {
  "0": "50",
  "1": "30",
  }
}

So this is 70~ bytes (mostly because of the syntax of json, but having a label "WorldProgress" makes this blob much more human readable.

To optimize that, should we do something like (strip the label, use comma to separate key/value). In that case it's almost like just use proto or binary instead of json.

{
  "0": "0,50,1,30"
}


So am I missing something here? It seems key / value allows much more storage (up to 1,000,000b) versus just 3 json objects and we need to be really careful of how to store them.

Thanks for the help

1 comment
10 |1200

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

Jon avatar image Jon commented ·

Not sure why the post duplicated the body twice. Can't edit it either.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Have you considered Player Data (including Read-only and Internal) to store those data? Entity Object seems to be a good place to store your required data, however, Player Data should be also feasible to handle it. it will have total 300,000 bytes for the value size. Entity objects and Player Data doesn't share the same limit. You may consider combining 2.

In terms of 1,000,000 bytes, do you mean Title Data? It is designed for player purpose and usually it is for global data for a game.

2 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.

Jon avatar image Jon commented ·

Yeah, we are considering using a mix of player data + entity object.

In terms of API rate quota / tps limit, are the quotas shared between player data api and entity object api?

If they are shared, then it would be more efficient to just call one api (entity object).


However, the downside of that, is that the entity object has to be provided in entirety each time (i.e. it's a insert or replace, not an update like with key / value)

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Jon commented ·

Entity object update rate and Player Data update rate are separately counted. Please search "Player data value updates" and "Entity profile updates" on the limit page.

0 Likes 0 ·

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.