The title explains it all. I have absolutely no clue how big of a table I can save to a datastore key. The wiki doesn't seem to have anything about it. I've heard its something like 64,000KB of JSON but I have no idea how to convert.
How big of a table can I save to datastore?
1 answer
One key can store 2 ^ 18 string characters (262144) currently, when a table is saved in a data store is it stored in a JSON format which is all handled internally by Roblox.
To give an idea about how much this is you can run the following code:-
print(string.rep('a', 2^18))
If somehow you do meet this limit you can check the string length by manually encoding the table to a JSON using JSONEncode note that you do not need to enable the HttpService to be able to use this function.
A quick example:-
local charLimit = 2 ^ 18
local httpServ = game:GetService('HttpService')
local function chkLimit(tbl)
return #httpServ:JSONEncode(tbl) < charLimit -- encode to JSON format and check the string length agains the limit
end
I hope this helps.
4 comments
Ah, characters, not kibibytes. I presume this table would be 5 out of the 262144. local tbl = {"a", "b", "c", "d", "e"}
JSON is a string representation of the table. You need to store all of the JSON for it to be valid so every character in the string counts towards the limit.
SO you can turn a table into a string??? Why is nobody explaining it logically....
Because you have not said you do not understand JSON, this link should help http://www.json.org/
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
https://scriptinghelpers.org/questions/26610/how-big-of-a-table-can-you-store-inside-of-datastoreservice
Thanks, but it doesn't state how big 1 letter is in JSON :/ The numbers are useless unless there is a way to determine its size..
You'll never reach the limit. simple as that.
Actually,reaching the data limit can happen pretty quickly if you save models to a datastore. Take "Whatever Floats Your Boat" as an example of this. Secondly, if you're really worried about reaching the data limit, look into string compression.
The wiki tells you exactly how much data would be too much... in the form of JSON. http://wiki.roblox.com/index.php?title=Data_store#Data_limit