Datastores: Unclear that "UpdateAsync" budget is actually minimum of set/get budget

As described here: (linked by section)


It should be documented on the wiki that:

local DS = game:GetService("DataStoreService")
DS:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.UpdateAsync)

Actually just returns the result of this statement under the hood:

local DS = game:GetService("DataStoreService")
return math.min(
   DS:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.GetAsync),
   DS:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementAsync)
)

Otherwise, suppose that the set budget is 500 and the get budget is 100, people might get confused that they don’t see the UpdateAsync budget go down whenever they perform an UpdateAsync call repetitively on the same key (because it would reduce only the 500, so UpdateAsync budget would still be 100 afterwards).

See linked post above for reasoning on why this is implemented this way. Simple tests with consecutive datastore calls can be constructed to show that this is indeed the case, or ask an engineer to verify the implementation.

3 Likes