Confusion about datastore limits?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

Ive always been a bit confused about the datastore limits but never dared to ask. Because i was scared people would harras me over such a simple question Xd

  1. What is the issue? Include screenshots / videos if possible!

Basically. I never really/still dont really understand what “Requests per minute” mean.
image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

The code im using atm to check the budget is this line. BUT i want to be EXTRA sure this is the correct way. Ive been holding on to this question for about 2 years now.

Heres an example of how any of my datastore modules would look like

local module = {}



local Api = game:GetService("DataStoreService")
local Store = Api:GetDataStore("-Test","")


function module:GetBudget(Type)
	return Api:GetRequestBudgetForRequestType(Type)
end


function module:WaitForBudget(Type,Num)
	repeat task.wait() until self:GetBudget(Type) >= Num
end

function module:GetNumPlrs()
	return #game.Players:GetPlayers()
end


function module:Get(Key)
	if self:GetBudget(Enum.DataStoreRequestType.GetAsync) >= 60 + self:GetNumPlrs() * 10 then
		
		-- // Do stuff
		
	else
		self:WaitForBudget(Enum.DataStoreRequestType.GetAsync,60+self:GetNumPlrs()*10)
		return self:Get(Key)
	end
end


return module

If anyone could answer this simple question. Thatd be super awesome so i can finally get it off my chest XD

Again. Im asking if this is the correct way. And if it isnt then i want someone who has some good experience with datastores that can explain to me what they mean with “Requests per minute”. I DONT want people linking modules like datastore2/profileservice :slight_smile:.

1 Like

You don’t have to do the math yourself, in fact the get budget function will give you the correct number. You only need to check budget to be above 0.

The are just stating on the website that you can make 60 request per minutes, with a bonus 10 for every player. Try to keep your data store requests below 10 per minute for player specific data and below 60 per minute for global game data

1 Like

Ah alr got it thanks. Sorry again if this was a simple question :sweat_smile:

1 Like