question

eric-2 avatar image
eric-2 asked

is there a limit to the number of characters of a single key?

I am creating a key that may have a lot of characters in the player data. I am wondering what is the number of characters limit?

Player Data
10 |1200

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

1807605288 avatar image
1807605288 answered

I think this might be an example of "There's no limit now, but if you abuse it too badly, we'll make a limit"

You can see some data size limits in the following url, replace {titleId} with your actual titleId:
https://developer.playfab.com/en-us/{titleId}/limits
Or just: Game Manager -> Settings -> Limits

I believe the key has to fit within a basic database row, and that row needs to be under some fairly small size. The values are saved to another location with a larger capacity, and a ref is saved in the row, so the value is an independent size (with an explicit limit, as shown).

So, while I don't know the MAX length of the key, I know it has a relatively small max, like... 500 bytes or... something on that scale. The values have limits in the 100KB scale +/- based on your tier, so there is no good reason to abuse the key size, in order to extend what you're saving in the value.

And, the "real" answer is: No, there's no explicit limit. There probably IS a limit where your api-calls will begin to perform [very] poorly, for potentially many reasons, and/or your api-calls will just fail (not necessarily consistently either). Barring all of that, if you're using the key size to abuse the value size limits, you'll force us to MAKE a limit.

So in other words, please don't get too crazy. If you're doing something exploitative, we'll see it and if it threatens the performance of the service, we'll enforce a reasonable limit to protect the stability of the servers.

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

eric-2 avatar image eric-2 commented ·

Thanks! That’s helpful to know ;)

0 Likes 0 ·
brendan avatar image brendan commented ·

I believe this is the data you're looking for (max length of a value string in the free vs indie/pro tiers): https://community.playfab.com/questions/13455/limits-for-pro-tier.html. Let us know if that doesn't answer your question, though.

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ brendan commented ·

Reading your original post, I think Brendan's answer most closely addresses your question. I think I got confused by "key", and I think Brendan was right when he answered for "value"?

Referencing this:
https://api.playfab.com/documentation/client/method/GetUserData

My answer applies to request.Keys.
Brendan's answer applies to the value, IE: value = result.Data[{key}]

Keys should be JUST big enough to be unique identifying strings.
Values should be the data, and their lengths are defined by the tier limits.

Is that finally, sufficiently clear? :D

Sorry about that, we all got our words crossed.

0 Likes 0 ·
pfnathan avatar image
pfnathan answered
10 |1200

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

eric-2 avatar image
eric-2 answered

That doesn’t help me. What I want to know for example for a single string entry, how many characters or what is the max size of the string? Characters as in letters in a string. Not game characters.

10 |1200

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

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.