Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is it better to save a table in Data Store or every value individually?

Asked by
KoreanBBQ 301 Moderation Voter
8 years ago

Would it be better to do

local tab={a,b,c}
Plr:SetAsync(Plr.Name,tab)
Or
Plr:SetAsync(Plr.Name.."a",a)
Plr:SetAsync(....b)
...c

And by better I mean taking less space, and to what extend is one actually better than the other.

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
8 years ago

I would suggest saving multiple keys to the datastore, rather than one key with a table / dictionary of all your data.



I'm saying this because, there is virtually no limit to how much you can store in a single datastore, but there is a limit to how much you can save per key. You can only save up to 64 kibibytes per key! This is equivelant to 2 ^ 16 string characters.



So, because your DataStore may grow to be too much data for one key, I just suggest having mupltiple keys.

0
Couldn't you save tables with JSON? funyun 958 — 8y
0
Yeah, but what does that have to do with the data limit. Goulstem 8144 — 8y
0
I don't know, I just read it here. I don't know if it applies to DataStores. http://wiki.roblox.com/index.php?title=Data_persistence funyun 958 — 8y
0
2^16 string characters is for the key as in for all players? KoreanBBQ 301 — 8y
0
2 ^ 16 chracters per key.. and @funyun, You couldn't save tables with Data Persistence without JSONEncoding them. But now we have DataStores so that information is irrelevant. Goulstem 8144 — 8y
Ad

Answer this question