question

La Fontaine avatar image
La Fontaine asked

Data: Entity actual best practices?

I’m implementing Playfab for my game, and I’ve been studying documentation these ast few days and this question isn’t clear at all from all I’ve read.

In your Consumption Best Practices pages it is implied that sending a lot of data writes with less than 1KB is not good, as each write has a minimum 1KB and this results in doing more writes than necessary. Thefeore, do fewer bug bigger key-value pairs. Which was enforced by several answear posts by your staff.

Ok. That’s how it was with PlayerData, the old system. But then there are posts talking about the new Entity Objects and how they, among other virtues, boast being good for small entries. Therefore, we can do small key-value pairs.

And I wanted a definitive answear about the best practice using Entity Objects: do I make my system send few big key-values or can I make small key-values?

The way my game is being done, I can do either. I can do a big key-value pair and send it all in one go, including within data that wasn’t updated. Example: making a big key-value pair containing all bools used in my save system. Game reads/write with low frequence, but when it does, it sends all booleans, regardless if they changed since last update or not.

OR I can do a small key-value pair for each variable. In the same example, with the same read/write frequence, I’ll send all booleans that were updated. There will be more calls (various small keys), but the overall data will be smaller this way. Using entity, which way is the correct?

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

·
Neils Shi avatar image
Neils Shi answered

Profile includes any data stored related to the player profile which also contains entity object and player data. In fact, the entity object and player data all have a 1KB weight for their meters, which means the player data and entity object are charged the same. You can refer to Pricing Meters - PlayFab | Microsoft Learn for more information about how profile related APIs are charged. In your case, if you want to store variables via multiple small key-value pairs, you may consider using player data, because for entity object, each master/title player account can only have up to 5 entity objects, which can not meet your needs. And the player data has no limit about the number of keys. If you want to store your data via few big key-value pairs, please note that the Entity objects have a size limit of 1000 bytes, and player data has a limit of 300,000 bytes value, you should choose which one to use based on the needs of your game.

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.