Using Data Stores to save large amounts of data

Hello DevForum,

I am currently working on a game that sells gears, when the player buys it, it is saved. Right now this is fine as we only have a few, but overtime we will be saving around 30+ values of gears per person. And this includes other data that we are also saving.

This is my dictionary for my datastore:

local Format = {	
	["Gears"] = {
		["Cake"] = false,
		["Cheez burger"] = false,
		["Pizza"] = false,
		["Hippo"] = false,
		["Monkey"] = false,
		["Panda Plushie"] = false,
		["Slingshot"] = false,
	}
}

How would I go abouts saving this more strategically to save the data size?

Instead of:

	["Gears"] = {
		["Cake"] = false,
		["Cheez burger"] = false,
		["Pizza"] = false,
		["Hippo"] = false,
		["Monkey"] = false,
		["Panda Plushie"] = false,
		["Slingshot"] = false,
	}```
you should only list gears they own, if they only own Slingshot, then
		["Gears"] = {
		"Slingshot",
	}

Yes, this is a good idea but it will still exceed the save limit.

The limit is 4MB per key. That means 4 million characters. Assuming each gear requires 20 characters to save, that is 200 000 gears. Will people really be having 200k different gears? Or did you not look up the datastore key limit.

There are way more efficient ways to save your data but i doubt you’ll need it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.