Is the DataStore request limit documented on create.roblox outdated?

I was wondering if the limit on the amount of requests you can send to the datastore every minute displayed on Roblox’s documentation website is outdated.


(site)

If this was true, wouldn’t it mean that I would only be able to send 70 GetAsync requests a minute (60 + 1 x 10 = 70), yet below you can see me send 71 GetAsync requests in under 2 seconds.


2 Likes

That is the incorrect order of operations. PEMDAS/BEDMAS states that multiplication occurs before addition, making 60 + 1 x 10, 60 + (1 x 10)

1 Like

Ah, i always forget youre adding a number times another

1 Like

There is a cache and cooldown of 5 seconds associated with get requests for the same key.

When the first get request is initiated for a specific key, it is added to a local cache on the server and a cooldown is initiated. Further get requests for the same key will not make a call to the datastore servers if the requests are triggered before the cooldown expires. Instead, these requests will return the cache and will not deduct from the request limit since no outside call was made. This means almost all of the Datastore calls in the picture were actually accessing the cache.

You can read all about it here: Details on DatastoreService For Advanced Developers

That being said, the get requests basically allow for 10 requests (disregarding the hard 60) in a minute per player…which is a lot. There is no reason to make a get request every 6 seconds for the same datastore key. Get the data, cache it on the server, modify the data in the cache, then save the cache periodically as well as when the player leaves.

2 Likes

Thanks @round_edsquare for linking the post, here is the same link anchored on the relevant section: https://devforum.roblox.com/t/details-on-datastoreservice-for-advanced-developers/175804#heading--cac

In my testing I found the cache cooldown to be 5 seconds, not 6 seconds, though Roblox may have changed it in the mean-time (have not tested it thoroughly in a while).

@heavenswilI As stated you are only consuming 1 from the get request budget since you are making 1 remote call and then the next 70 requests after that are cached and do not actually make any remote call. The value you see in these 70 subsequent requests may be stale. You can check this by printing/viewing the budget for get requests.

2 Likes

Hi, round_edsquare. I am sorry for not making it clear that I am not sending those 71 requests to the same key; you seem to have missed the tiny code at the top of the outputted numbers:
for i = 1, 71 do game:GetService("DataStoreService"):GetDataStore("Random"):GetAsync(i) print(i) end

I am actually sending 71 requests to different keys, hence my confusion on the topic.

2 Likes

Whoops! I missed the :GetAsync(i).

The easiest way to find out what’s going on is to check the Request Budget.

2 Likes

In that case please review this section: https://devforum.roblox.com/t/details-on-datastoreservice-for-advanced-developers/175804#heading--lim

Note that you don’t just get the per-minute budget but you also get a starting budget. (this budget also varies between in-game and in Studio)

The 71 requests easily fit into the 100 starting budget. (The 100 may have changed, just review the budget tab in the console to see what the actual values are, if different.)

2 Likes

It’s highly recommended to give that resource a solid read as it also includes situations that will increase the budgets such as using the command bar/plugins and backlogged budgeting.

2 Likes

Ah, now I understand; I had previously overlooked that part. Thanks for writing that article; it was of great help, as the Roblox documentation covers too little.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.