Which is the best way to store data, the most efficient way which can prevent data loss? I am creating my own game but I am afraid that I will face data loss issues. Can I get some suggestions? I want to use a datastore which is able to save data and load it even if ROBLOX’s datastore is down. Game developers could you show me what methods do/did you use to save store data in your games and how satisfied are/were you with it? Did you face any issues? Data loss?
What I do is have a backup key for player data, and that is ONLY overwritten if the player’s data had checksummed content when the player joins the game.
It’s impossible to distinguish a loading failure from the first time a player joins, so I always write over the player’s “main save” if that is the case, but not the backup.
If the player does have valid data when they join, then I write over the “backup save” instead of the main save.
Then, when loading the player’s data, I check if they have a backup first, and use that if it exists; otherwise, if they have a “main save” (which you should get the first time a player joins), I use that.
That’s about the best you can do from my experience. There might be improvements that you can make (such as never overwriting backups by making a new save every time the player leaves), but the biggest issue is if the player does something in a play session that doesn’t get saved. That’s unavoidable unfortunately, unless you set up your own server endpoint for this.
If Roblox’s datastores are completely down, your game will probably be down too. Ignoring this, the method you have the most control over would be an external web server that manages data, but this is difficult to maintain and a much easier method is to use DataStore2 which is also more reliable than normal datastores due to backup data being saved.