You can write your topic however you want, but you need to answer these questions:
- 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
- What is the issue? Include screenshots / videos if possible!
Basically. I never really/still dont really understand what “Requests per minute” mean.
- 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 .