Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

5 comments

0

Couldn't you save tables with JSON?

0

Yeah, but what does that have to do with the data limit.

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

0

2^16 string characters is for the key as in for all players?

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.