In a game of mine, i save a lot of data for the Player and i was wondering if saving too much data can lose you some Data, because i am currently running into this issue, i was thinking that if i maybe switch to buffers the issue could be resolved?
I save data during run-time, so no Data is saved when the Player leaves.
I do this because in the past i also lost Data because i was saving it all once the Player left.
Roblox’s DataStore has a 4MB limit per key and enforces rate limits, so exceeding these can result in lost data. Frequent saving can also trigger throttling, causing some saves to fail since the system does not guarantee every save will succeed. Additionally, relying solely on runtime saving without handling shutdown properly can lead to data loss if a server crashes or a player disconnects unexpectedly.
Oh sorry i kind of said “save on run-time” wrong, i write to my Data on run-time but ProfileStore doesn’t just save on every write, it saves every few mins and on leave, but good to keep in mind.
So the 4MB limit, is there a way to check that? And do you think buffers are a good alternative option?
That’s a lot of data. Maybe split that up or look for ways to cut things down. You could always create “tables” that are not so long like 1 = Shovel, 2 = Light…
Maybe someone that has made one this big would know more.
I can’t check the actual size without knowing Make_Enemy_Default_Data() would output, but excluding it, the template’s size is 813B, just 0.02% of the storage limit.
Even if you have lots of values stored in the user’s data, it is extremely unlikely that you would reach the limit.
(I checked the size by JSONEncoding the table, then checking the length of the resultant string. As 1 character = approximately 1 byte, I can then calculate the storage usage of the table)
If you are running into the datastore limits, you will get errors (although ProfileStore probably catches them, but surely it still emits a warning or an error of its own)
If you aren’t running into errors, then you could have an issue in your implementation of ProfileStore, that is causing your dataloss
Also you likely aren’t reaching the 4mb limit, 4mb is a lot
Buffers would complicate your code for no real benefit
Enemy_Default_Data, just makes a very small table with only a few keys with number values, so i don’t think it would amount to much, very interesting that the Template is just 0.02% of the storage limit.
These are logs from one of my games, and in that game, I’m storing basic information about roblox games, in roblox datastores
So, with 2242 games stored, I’m at 0.063% of the 4MiB limit (This notation is 1KiB = 1024 bytes, same as KB, but then kB is 1000 bytes, …, it’s confusing)
The information being stored is this
The numbers are compressed into base 92 (datastores can only save 93 of the 256 1 byte characters, and I use “_” as a data separator)
So we are talking about 30 bytes per game stored, which is probably quite a bit less than what a player in your game would consume, but then your player’s data is not being saved 2000 times in the same datastore, and even if it was, you’d have leftover space
As for what the issue could be, you haven’t provided enough information for anyone to help. You need to post your scripts that are relevant (post more than needed, as some people will assume the issue cannot be there or there, but it ends up being somewhere they didn’t post), and then we can start helping
I will also say that getting people to help you about a library, like ProfileStore, will be harder because a lot of people (me included) are not familiar with it
Thanks for the reply! I just found what the problem was, it was just an implementation error like you said, but still very interesting that such little data is still being used, but it’s good to always minimize data usage.