GetAsync() and SetAsync() dilemma

So, I’m working on a personal game. It heavily relies on DataStores in which I have to use GetAsync() and SetAsync().

As stated in an official ROBLOX article, the limit (per minute) for calling GetAsync() and SetAsync() is 60 + numPlayers × 10. (Documentation - Roblox Creator Hub)

Now, I am in a dilemma. While rescripting my data-saving code, I eventually came up with this style of saving data:

local Avatar = {
Hair = hairinfo,
Face = faceinfo,
Package = packageinfo,
};
data:SetAsync(plr.UserId,Avatar)

With the code above, will :SetAsync() (or :GetAsync() if I were to load them in) count as it was called once (with those 3 values inside (hair, face, package)) or will be be called 3 times?

Best regards.

Everytime you call SetAsync()/GetAsync(), it would be called a single time. So the answer is, it will count as one as its called once. But i recommend to pcall SetAsync and GetAsync as there may be chances of it erroring. For example when the API is down.

So, regardless of how many values I put in there, the whole thing will be called once?

Yes. So even if you put 30 values in it, it just saves as one.

1 Like