question

brendan avatar image
brendan asked

Optimizing player data

Question from a developer:

We have a game where there are over 1,000 levels, and we're saving data on each level as a separate key/value pair. Is this optimized, or are there any negative effects to this?

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.

1 Answer

·
brendan avatar image
brendan answered

In our current data model, very small key/value pairs aren't efficient. Basically, if it's under 1KB, it's still taking up a 1KB slot - it's very similar to file allocation, basically. We'll be updating later this year with a newer data system that will provide better support for small (sub-1KB) data, but for now I would recommend aggregating information for levels together, to make fewer, larger keys.

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.

macun1903 avatar image macun1903 commented ·

we can create all of our levels in json format for sync, can we send and retrieving to json file via playfab , whats your opinion is it work or not ?

0 Likes 0 ·
brendan avatar image brendan macun1903 commented ·

Yes, encoding player data as a JSON object and stringifying that as the data in a player data key/value pair is a very common usage pattern. It would definitely be more efficient in our current data model.

1 Like 1 ·
sowee avatar image sowee commented ·

Hi Brendan, what's this newer data system you were talking about, is it out yet? Thanks!

0 Likes 0 ·
brendan avatar image brendan sowee commented ·

Yes, it's the Entity data model - https://api.playfab.com/docs/tutorials#entities. The first tutorial on getting started with Entities shows how to use the Object/File systems we've added.

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.