Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Discussion Backup of Cloud Saved Player Data?

Discussion in 'Cloud Save' started by wuzytech, Jun 26, 2023.

  1. wuzytech

    wuzytech

    Joined:
    Mar 13, 2023
    Posts:
    11
    has anyone thought about backup of the player data? I don't see any build-in function that can backup the whole player database.

    I'm worried if a player data is broken somehow and that I need to restore to the previous day.

    one method I could think of is that. when a player logs in. I will take a snapshot of all the keys/values and save as key1_bak/value key2_bak/value...
    then next day when the player logs in again. I refresh the key1_bak/value key2_bak/value.....
    but what if I accidentally deleted this player and all it's keys?

    How do you think about the necessity of backing up?
     
  2. francoisjjunity

    francoisjjunity

    Unity Technologies

    Joined:
    Nov 23, 2020
    Posts:
    40
    Hi wuzytech,

    We continuously back up the data in Cloud Save and we have redundancies in place. We are able to recover in the case of catastrophic failure of the database (a highly unlikely scenario).

    If you are concerned about corrupting your data from your game clients in Cloud Save, and the volume of data is relatively low, then your idea of a backup in a secondary location is a good one. You could either store the data in a another key in the player data Cloud Save item, or you could use the Custom data APIs via Cloud Code to store these backups. See this page for the javascript sdk or you could use Cloud Code C# modules and use the nuget package.

    You could also consider packaging all the player data into a single json string and store that under a single key in Cloud Save. Remember that there is a 5MB limit for Cloud Save item across all keys within that item.

    Hope that helps.
    Francois
     
    wuzytech likes this.