So I am currently making a game and I am really scared about the dataloss, i am planning to use 6 datastore keys, will it cause dataloss, if so what is the recommended datastore key use
DataStoreService intermittently fails. I suggest looking into DataStore2 (that’s what I’ve heard from the kids on the devforum at least). Because DataStoreService fails sometimes and if you don’t want to learn DataStore2, the wiki says you can wrap you DataStoreService API calls in pcall (protected call) and repeatedly retry to read/write from the data store. This isn’t for sure going to solve connectivity problems, but it will at least re-attempt to read/write.
Also take a peak at DataStoreService’s AutomaticRetry property.
Good luck!
how would i go about adding pets to datastore2 like when i add pet folders how would i increment
I haven’t worked with DataStore2, but I don’t think you can actually save data models / pet instances in any Roblox data store. Instead, you would want to save a table of values which contains data about which pets a certain user has. There are plenty of threads on the devforum regarding savings tables via DataStore2. I implore you to search them up!
ok thank you but whats the rate of losing data without datstore2
It does not occur too frequently, but it still manages to piss off a ton of players if your game is popular and people are joining and lose all of their progress. Also, be careful not to overwrite their data. I’ve played games before where DataStoreService failed to read my old data and the developer overwrote my data when connectivity was re-established so I had to start the game all over again.
DataStores, in general, may fail at times. However, it’s rare to see this. i’d recommend saving the player’s items by having the key be their UserId. That way, if the user were to join later, it will look into what their user id is and adds their data back.
so what happened was my first game blew up i got recommended #1 in roblox recommendation and it had 2300 concurrent players and that day a lot of people reported dataloss
For that, it may be on Roblox’s end, not yours. You may want to use DataStore2 as suggested earlier.
i have a question, so my game was called Rebirth Simulator, basically what u do is u automatically get dust every 0.01 seconds and u step on buttons and get different tiers, from what i know about datastore2, everytime u increment ( so lets say give dust every 0.01) and it saves that wont it throttle?
DataStore2 caches data internally when you update it. The only time it will save is when players leave or the server shuts down. It will not throttle if you use it correctly by reading the documentation: DataStore2
? DataStore2 is just a resource which utilizes DataStoreService at the end as well, if roblox DataStores are down then DataStore2 won’t function much differently, only thing different is that Ds2 saves time handling data.
Keys or stores?
You could just use one DataStore and save a dictionary of different keys and values,
DataStore:SetAsync(UserId, {Coins = 10; Cash = 5})
-- instead of
CoinsDataStore:SetAsync(UserId, 10)
CashDataStore:SetAsync(UserId, 5)
-- consider protected calls + UpdateAsync for stores written to by other servers
Edit:
I’m saying all it does is save you some work, not that it’s a bad approach or anything.
@TheSunBeside it is ok, but not good practice at all.
Just save a dictionary instead.
this is what i meant by keys so is it okay i use 6
DataStore2 includes caching and data loss prevention techniques. My point is that this approach has been proven to prevent data loss more than using just DataStoreService alone.
Personally, I get that DataStore2 is good, but I don’t see myself switching to it any time soon, because I haven’t had any problems with the normal one. If you’re able to write your own data store techniques (like a module, I wrote my own) you should be fine
is there any chance that i can get your datastore since i am very bad at it and dont understand it
Unfortunately no because I wrote it for my personal use, and even if I gave it to you I don’t think you’d understand it at all because it’s kind of complex
This is a pretty good resource for you to start though: Documentation - Roblox Creator Hub
I find datastore2 useless, I made my own datastore system that saves parts tools and values and found it much easier to manage than datastore 2.
i just dont know which datastore to use because my last one was causing too much dataloss