Reached my Datastore limit is that possible to bypass the limit of 4 millions MB saving data?

I don’t know what’s causing the saving issue on the EXP Per click but it seems like my number is big and it just can’t save the new value when I increase the Exp Per Click when I quit and comeback in the game. Is there a way to encode character or use BigNumber module to counter this issue ?

On Value increase :

When I comeback in the game :
ScreenShot_2024-05-13_12_49_28

1 Like

There are limits on the API call of the datastore. If I’m correct it’s 60 request per minute per player. That might be the issue. If not, tell me and I’ll go down every single website to find something.

1 Like

I tried the tutorial of Suphi Kaner because basically I have to convert back the value of Exp from the default base 10 to a bigger base so I can afford bigger value size in Roblox but problem is profile Service doesn’t seem to save string value

local module = {}

local characters = {
	[0] = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
	"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
	"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
	"!", "#", "$", "%", "|", "'", "(",")", "*", "+", ".", "/", ":", ";", "<", "=", ">", "?", "@", "[", "]", "^", "_", "`", "{", "|", "}", "~"    
}

local numbers = {["0"] = 0}
for i, character in ipairs(characters) do numbers[character] = i end

local base = #characters + 1

module.Encode = function(value)
	if value == 0 then return "0" end
	local text = ""
	if value < 0 then text = "-" value = -value end
	while value > 0 do
		text = text .. characters[value % base]
		value = math.floor(value / base)
	end
	
	return text
end

module.Decode = function(value)
	local number = 0
	local power = 1
	for character in value:gmatch(".") do
		if character == "-" then
			power = -power
		else
			number += numbers[character] * power
			power *= base
		end
	end

	return number
end

return module

Someone know how to save string value with Profile Services is that possible ?

It seems data compression allowed me to push the limits of digit handling of data saving

How r u saving your stuff right now? Profile Service should be same as normal Roblox datastore in terms of creating values to save.

Eg,
Local string = instance.new(“StringValue”, player) – or something of similar sort

I had to reset the datasaving and also to fix the number on the bigger number I had to encode the data and revert it to normal once back to the game basically

Yeah basically I screwed my saving and had to reset everything back to normal so after everything was good hate this when it happens when I screw things so bad on saving

There are limits to how much data you can send to datastores per minute, on top of how many times you can do so - and that limit is 4MB.

Getting that error suggests that you may be sending too much data over, so the easiest way to fix it is to just… slow down and stop sending so much data.

Don’t save data into datastores anytime it changes - save it into a cache in the server, and save that cache to the datastore when the player leaves.

I don’t think it has anything to do with the request the simple fix was to compress the data into a bigger number base than the radix 10 of our decimal system

Because the data found that there was too much character in the string sequence

Re-read what I said.

There are limits to how much data you can send to datastores per minute […] - and that limit is 4MB.

Mmm so then now I don’t know if it’s the rate of data sent per minute or the number of character in the value then

so what about simply reducing the values. Its probably annoying to recalculate but is it necessary to have such big values?

Because that’s not solving the problem it’s like posting a sticker on a broken glass where water get out what I mean is if I want our game to be able to handle big number I have to find ways to surpass the limit of lua interpreter putting small number would be the simple path but it’s not gonna solve the problem

You cant. Its the set limit by roblox of how much data you can use per key, unless you want to create a new key (which I dont recommend), you need to compress how much data you’re taking up.

Each character takes up around 1 byte, 4MB as already stated is the set limit of how much you can use. If 1000 bytes is a Kilobyte, and 1000 kilobytes is a megabyte, that means you can store a maximum of around 4,000,000 bytes, this a pretty big number for data, and most DataStores barley even take up .001% of that space provided by roblox, so whats likely the case is that you arent storing your data properly, or you arent being efficient with how things are stored, because 4,000,000 bytes is an very big number that can hold a lot of information.

If you want to calculate how much data you are using in your key, convert said data into JSON using HttpService:JSONEncode() and then using # to get the number of bytes (or the size) of the data being stored, you can then divide by 4 million, multiply by 100, and there you have a percentage of how much space you are taking up.

Note, MB is 1000 Kilobytes and Kilobytes a 1000 bytes, if you think I am miscalculating and the real number is 1024, you are using a different system of measure, which is Kibibytes, and Mebibytes.
no matter what system is used, you will still get a number roughly in the 4 millions.

Megabyte Calculation: 4(1000^2) = 4,000,000 bytes
Mebibyte Calulation: 4(1024^2) = 4,194,304 bytes
(even still, a good rule of thumb is to be below 4 million bytes.)

2 Likes

Sigh…

4MB as already stated is the set limit of how much you can use.

There’s a difference between storing and sending data - they both have different limits.

When I said 4MB, it’s literally how much data is allowed to enter into datastores per minute - and that quota is on a per key basis.

In other words, you can’t send over a total of 4,000,000 characters to a datastore key in a single minute. If you try, it’ll error.
Meanwhile, a key can store 4,194,304 characters.

And as I said, if you want the problem to go away, stop sending so much data so frequently.
Either compress, or implement caching.

2 Likes

At times you have to be reasonable, considering what everyone else is saying. But if you are still trying to find a solution, then update me on what you find

I know this sounds dumb, but give it a try;
Try to divide the big number to save it, and to receive it multiply it. It may not be the best solution you’re looking for, but would do the job.

So for example, divide the big number into 1.000 (or something) and save it. Then to receive the data, multiply the data times 1.000.