I have looked at several posts on here, and googled a bunch, and I can’t seem to understand how datastores work.
I am wanting to store a table (keyed) into a datastore. I read somewhere that you can not do this unless the table is json encoded as a string. Then the string can be written to a datastore key (im using player.UserId). The part I don’t understand is how Roblox states each key in a datastore can hold 2 megs of data, yet a lua string (if I convert table to json string) can only be 200,000 characters. So how is each datastore key able to hold 2 megs of data?
Also, when looking in the examples on Roblox (which state nothing about datastore valid types) I see the examples will have one datastore for nicknames, one for inventory, etc… I have been just using one single datastore for everything (custom house inventory, player inventory, player outfit saves, regular inventory, among others) Should I be using multiple datastores? If so, would reading from each of them all add to a global limit on datastore access or does each datastore have its own limit?
It would be nice if you could just pass in a keyed table (with some value being sub keyed tables) to a datastore, and it just save it, just work. Of course I know you cant have things like instances, or cframes, or stuff like that, I am just talking about tables with bool, numbers, strings, and keyed tables of those.