Protecting Users' Data From Corruption

I’m working on a project right now, and before going forward with writing a module for storing players’ data for it, I want to know if there’s any practices I should follow to help in a (unlikely but never impossible) case of a player’s data being corrupted due to an issue on my end.

To give more detail, I’m using Roblox’s data stores. I doubt this would ever be the case when it comes to something simple like saving experience points or saving currency as these are just numbers. My biggest worry is when it comes to saving inventories of items. I’ve never ran into any issues before with it, just taking precaution since I would hate for someone’s data they worked hard for (or even paid for some of it) to go to waste.

In case I haven’t been clear on the case I want to be ready for just in case, here’s a set of hypothetical steps:

Roblox user Timmy plays the game
Roblox user Timmy spends a lot of time gaining items and spending on items
I make a mistake and before catching it, Timmy plays the game and their data is corrupted

Is there any steps that can be taken to set up a player’s data where that can be rolled back? Or is this just something that I need to be thorough with on my end and hope it never happens?

1 Like

You could use a duplicate DataStore for the purposes of backup.

However there isn’t really a good way to check for corrupted data, at least without a specific system to reference, so restoring the corrupted data with the backup data is not something you could do automatically and without delay (therefore leaving the backup data vulnerable to being corrupted).

4 Likes

https://devforum.roblox.com/t/best-way-to-use-datastores-with-minimal-data-loss/32159/3

12 Likes

Can’t access that since I’m only basic user level.

1 Like

I’ve quoted the original post

Oh oops. Didn’t load immediately, sorry.

1 Like

I bet that uses a ton of storage. Do you clean up old saves?

We’re not the ones paying for storage lmao

For real though the only storage limitation we have is the size of a single entry.

And at that, a max save is 260 KB. It would take a ridiculous amount of keys saved at max file size to have a significant impact for Roblox