question

MoonHeonYoung avatar image
MoonHeonYoung asked

curious about userdata

Hello

My game is structured to store all save data in one key through updateUserdata call.

It also saves about 3 times per 10 seconds.

When you log in, the save data is loaded and the data is loaded.

What I'm curious about is, is there a chance that this save data may be broken or not properly stored?

If so, the user will not be able to load the data.

For example.. When the user closes the app, updateUserData is called, but the transmission is not appropriate, so only half of the data is updated. Do examples like this exist?

Or, if the Internet connection is disconnected during data transmission and 100% of the data cannot be reached..

If such a case exists. I think we need a solution.

Should the save data be divided and stored?? Is there a good solution in this case?

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

·
Rick Chen avatar image
Rick Chen answered

No, the scenario you described will not happen. One UpdateUserData call makes one database transaction, meaning either all user data is updated in one call or none of the data is updated. There is no part-of-data-updated situation. To keep the data integrity, it is better to update the data in one call. Storing all data in one key is fine, but please be aware of the player data value size limit, you could check the limit in [GameManager]->[Your Title]->[Title settings]->[Limits] and find the player data value size.

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.

MoonHeonYoung avatar image MoonHeonYoung commented ·

Thank you so much for your answer This is the answer I want.

It has nothing to do with the context, but I have one question.

I am saving and loading all the data of my game into JSON in one key.

that is, it is overriding the existing save key. Is it okay to live-service the game this way?

What I'm worried about is that if the existing save key/value exists, and when trying to save new game data, it seems like a better way to design it in a way that handles only the changed parts of the existing data.

Of course, this method seems to be very expensive for maintenance.

Is it okay to operate in a way that overrides all data economically like my method?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ MoonHeonYoung commented ·

Your current implementation is fine. It is recommended to aggregate data into fewer, larger keys wherever possible. It is space economical and efficient. Please refer to: https://community.playfab.com/questions/7904/keyvalue-limit.html.

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.