Which is better method of storing the data given from the datastore

So basically whenever I get data from a datastore I make them into value objects so I dont overflow the datastore with requests, I put these value objects in the player. But I thought about it and think module scripts are a better solution. So which do you think is more efficient using tables or value objects?

1 Like

What kind of data are you storing?

Well I have data such as twittercodes used, powerups owned, sword data ect. I usually user folders and place value objects correesponding with the sword name, from the data given from the datastore. Some people use module scripts, I was wondering if my way of storing data was inefficient or something

Your way isn’t inefficient, it is actually more efficient than module scripts.

Oh, ok. So when would you prefer module scripts, or why would you prefer module scripts instead?

How would you use module scripts in storing data?

Like this

AllPlayerInfo= {}

return AllPlayerInfo

Inside the datastore saving script:
local AllPlayerInfo = require(game.serverscriptservice.AllPlayerInfo)
local Datastoremodule = require(game.serverscriptservice.DataStoremodule)

game.players.playeradded:Connect(function(player)

AllPlayerInfo[player] = DataStoreModule.get(player)
end)

also this was just pseudo code to demonstrate it

This is definitely not as efficient as using values.

yah ok, ill see what other people have to say, I think I might move this to discussion