There are a few datastore problems I’ve heard get talked about here, but I’ve never actually found a solution to any of these.
1. What do I do if a player leaves a server and joins another quick enough that the first server doesn’t save in time and the second server loads older data?
2. Should I overwrite data if when using UpdateAsync the older data is infact more recent data? What if a player made a purchase on older data, do I still overwrite that data even though they purchased, for example, currency on that old data save?
3. Am I responsible if a player purchases currency and through an error their data is lost to refund them? I’m assuming so, and if so, how do I verify that they actually lost data with a purchase?
4. How do I accurately test datastore errors to prevent an unknown bug in my script causing major data loss in the future?
5. What is the best way of handling data loss if a player leaves a server and I am unable to successfully update their data? For example, if Roblox datastores are down? Do I just accept I can’t do anything and let their data go unsaved? What if they made a purchase, and I was also unable to record their purchase in a datastore?
6. Do I include error handling for every error separately, listed on the developer hub? Would that be unnecessary to do?
7. Am I overthinking or over worrying about these problems? Is making a secure save system with minimal data loss as simple as using pcalls, certain good practices and leaving it at that?
Most examples I see on datastores are relatively simple, with using pcalls and retrying a few times. Is this all you need to do? I’m assuming most games on the front page use techniques or better ways of saving data with datastores. I feel very lost working on datastores because I hear about all these potential problems with datastores, yet all the examples I come across seem to not mention anything about these problems. I’m attempting to make a near perfect system so I wont ever have to deal with data loss or refunding purchases, but I don’t know if I’m worrying too much about this.
Also whenever I begin working with datastores I usually decide it’s too stressful and end up using Datastore2, I’m hoping to avoid using Datastore2 in order to help myself get better at scripting and understanding exactly how datastores work. Thanks!