Will this cause data store limit warnings?

So I am making this game with a lot of obbys, each on with a global leaderboard.

I want all the global leaderboards to be updated by 1 script.

So this is basically what I did:

--example script

local DataStoreService = game:GetService("DataStoreService")
local Obbys = workspace.Obbys


while true do
	wait(10)

	for i, Obby in pairs(Obbys:GetChildren()) do
		local ObbyODS = DataStoreService:GetOrderedDataStore(ObbyName.. "ODS_Test2")

		--SetAsyc()

		--Do the rest of the global leaderboard stuff
	end
end

I am wondering if this will be too much for the limits, for example if I have like 100 obbys?

Yes.

According to the limits on the wiki (Documentation - Roblox Creator Hub)

There is a 6 second cooldown on write requests. In the example you posted, you would be writing multiple times inside of your for loop.

Why not try looping through your obby first and store it inside a table. Then once you’re finished you could save it to the datastore.

1 Like

Sorry I dont quite understand, What should I store inside a table?

I’m pretty sure that 6 second limit only applies per key, not in general.

Sorry I dont quite understand, What should I store inside a table?

The data which you want to upload to your data store with setAsync. It’s best to collect all the data ingame that you want, and then doing it in one go rather than making frequent calls to the DataStore.

I’m not sure what type of data you’re wanting to save, but to give an example from the wiki (Documentation - Roblox Creator Hub). Notice how they use a sessionData table to contain everything, they can update this whenever they want but the table only gets uploaded to the datastore once every minute.