Once DataStore Versioning was implemented recently, I wonder if the additional data saved in each version will consume the 4MB DataStore quota?
If so, this could be dangerous, as a change to a large table using SetAsync
will duplicate this table in each version of the DataStore and take up more and more space within the available 30 days.
1 Like
Good question!
The answer is no, it doesn’t count towards the quota.
Test Script:
local DataStoreService = game:GetService("DataStoreService")
local store = DataStoreService:GetDataStore("test")
local key = "big"
wait(2)
store:SetAsync(key, string.rep("a",4100000))
print("set a string")
wait(2)
store:SetAsync(key, string.rep("b",4100000))
print("set b string")
wait(2)
local versions :DataStoreVersionPages = store:ListVersionsAsync("big")
for _,v :DataStoreObjectVersionInfo in pairs(versions:GetCurrentPage()) do
local good,str = pcall(function()
return store:GetVersionAsync(key, v.Version)
end)
if not good then warn(str) end
print("FirstLetter",str:sub(1,1),"strln",str:len(),"Time", v.CreatedTime, "version", v.Version)
end
.
Result (I ran it a few times lol):
1 Like