I recently read more in depth about how data store works on the roblox wiki, and found that each key is limited to about 2^16 string characters of data (64 kibibytes). Which means using JSON on tables depends on how big the table is, which causes a HUGE problem for my project.
Here's an example:
local player_data = {}
local http = game:GetService("HttpService")
local data = game:GetService("DataStoreService"):GetDataStore("Test")
data:SetAsync("player_info", http:JSONEncode(player_data))
print(data:GetAsync("player_info") and "Data found" or "Data not found") -- Result is as expected
for i = 1,2^16 do
table.insert(player_data, '.')
end
data:SetAsync("player_info",http:JSONEncode(player_data)) -- Says value is to large!
print(data:GetAsync("player_info") and "Data found" or "Data not found")
Please help! This means things like chat logs saving, complex stats saving, and anything else that involves a lot of memory to be stored based off players is very limited! Is there any way around this?

2 comments
Thanks for the answer, but i still get the same result: "Value is to large" :/
Change the part's size to (2^16)-1 in stead of 2^16?