You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -478,38 +478,44 @@ Data stores are subject to both <b>experience and server-level limits</b>. Exper
478
478
479
479
Each experience is allowed a certain number of data store requests based on the data store type, request type, and number of concurrent users. For each data store type and request type, the limit is shared among all listed functions.
480
480
481
-
Note that `Class.GlobalDataStore:UpdateAsync()|UpdateAsync()` consumes from both the read and write request budgets. A single call will decrement both limits.
481
+
-`Class.GlobalDataStore:UpdateAsync()|UpdateAsync()` consumes from both the read and write request budgets. A single call will decrement both limits.
482
+
- Game server and Open Cloud **share** a budget; Open Cloud traffic can be throttled by in-experience usage (and vice versa). See [Control rate limits](#control-rate-limits) for further guidance.
Because Open Cloud and game server requests are shared, it is important to independently control how much each can consume from the budget.
565
+
566
+
<h6>Game server</h6>
567
+
568
+
Individual servers have built-in limits, as described above. Use a combination of `Class.DataStoreService:SetRateLimitForRequestType()|SetRateLimitForRequestType()` and `Class.DataStoreService:GetRequestBudgetForRequestType()|GetRequestBudgetForRequestType()` to maintain fine-grained control over individual servers' contribution to the total budget.
569
+
570
+
<h6>Open Cloud</h6>
571
+
572
+
Open Cloud requests require an external rate limiting solution. We recommend one of the following approaches:
573
+
574
+
- (Simple) Add a short timeout after each request, especially if calling the same API in a continuous loop. Set this timeout equal to `60 / (desired budget consumption per minute)` seconds, as an upper bound. Note that this approach does not allow requests to be sent in bursts.
575
+
- (Robust) Implement a local rate limiter using the leaky bucket strategy.
576
+
577
+
The following Node.js code samples include reference implementations.
578
+
579
+
<Tabs>
580
+
<TabItemkey = "1"label="Timeout rate limiting">
581
+
582
+
```js
583
+
constapiKey=process.env.API_KEY;
584
+
if (!apiKey) {
585
+
thrownewError('The API_KEY environment variable is not set.');
586
+
}
587
+
588
+
constapiHeaderKey='x-api-key';
589
+
590
+
constuniverseId='';
591
+
constdataStoreId='Inventory';
592
+
593
+
constbaseUrl='https://apis.roblox.com/cloud/v2/';
594
+
595
+
// --- Per-operation rate limiting config (requests per minute) ---
596
+
constLIST_RATE_PER_MIN=60;
597
+
constGET_RATE_PER_MIN=120;
598
+
constUPDATE_RATE_PER_MIN=60;
599
+
600
+
// Upper-bound spacing per operation: 60 / (requests per min) seconds.
console.error('An error occurred during execution:', error);
788
+
}
789
+
})();
790
+
```
791
+
792
+
</TabItem>
793
+
</Tabs>
794
+
551
795
<h4>Server limits</h4>
552
796
553
797
Each server has a configurable rate limit for each request type, based on the number of players in that server. Servers receive a one-time startup burst of additional request budget when they are first created. Use `Class.DataStoreService:GetRequestBudgetForRequestType()|GetRequestBudgetForRequestType()` to confirm the number of data store requests that the current server can make at any given time.
@@ -564,7 +808,7 @@ The following **default rate limits** apply if the API is not called:
564
808
<tr>
565
809
<th>Request type</th>
566
810
<th>`DataStoreRequestType` Enum</th>
567
-
<th>Functions</th>
811
+
<th>Game server API</th>
568
812
<th>Requests per minute</th>
569
813
</tr>
570
814
</thead>
@@ -609,7 +853,7 @@ The following **default rate limits** apply if the API is not called:
609
853
<tr>
610
854
<th>Request type</th>
611
855
<th>`DataStoreRequestType` Enum</th>
612
-
<th>Functions</th>
856
+
<th>Game server API</th>
613
857
<th>Requests per minute</th>
614
858
</tr>
615
859
</thead>
@@ -721,16 +965,22 @@ Roblox examines the usage of quota associated with the key over the last 60 seco
<td>Create, Update, Increment, Remove Data Store Entry</td>
734
984
<td>4 MB per minute</td>
735
985
</tr>
736
986
</tbody>
@@ -739,15 +989,15 @@ Roblox examines the usage of quota associated with the key over the last 60 seco
739
989
In addition to the above throughput limits, Roblox organizes data into partitions based on an internal schema. As a result, when the backend server receives a high volume of requests to the same data store, it can result in further throttling. Regardless of the cause, throttling manifests as either `DatastoreThrottled` or `KeyThrottled` errors, depending on whether the throughput limit was exceeded for a single data store or a key. These error messages apply to both ordered and standard data stores.
740
990
741
991
<Alertseverity="info">
742
-
For every request, Roblox rounds throughput up to the next kilobyte. For example, if you write 800 bytes and 1.2 KB in two requests, Roblox counts that as 3 KB total throughput (1 KB and 2 KB, respectively).
992
+
For every request, Roblox rounds throughput up to the next kilobyte. For example, if you write 800 bytes and 1.2 KB in two requests, Roblox counts that as 3 KB total throughput (1 KB and 2 KB, respectively).
743
993
</Alert>
744
994
745
995
### Storage limits
746
996
747
-
In the future, to provide a scalable and stable storage experience, data stores will implement an experience-level storage limit on your storage usage.
997
+
To keep storage stable and scalable, data stores use a game-level limit on your storage usage.
748
998
749
-
This limit will be the sum of a base limit for each of your experiences and a per-user limit based on the number of lifetime users in your experience. A lifetime user is any user who has joined your experience at least once.
999
+
This limit is the sum of a base limit for each game and a per-user limit based on the number of lifetime users in your game. A lifetime user is any user who has joined your game at least once.
750
1000
751
-
The storage limit will be calculated using the formula `Total latest version storage limit = 100 MB + 1 MB * lifetime user count`.
1001
+
The storage limit is calculated using the formula `Total latest version storage limit = 500 MB + 1 MB * lifetime user count`.
752
1002
753
-
Any keys that you delete or replace, even if still accessible through version APIs, do not count towards your experience's storage usage. However, entire data stores deleted via the Open Cloud [`DeleteDataStore`](/cloud/reference/DataStore#Cloud_DeleteDataStore) method continue to count towards your storage usage for the duration of their 30-day processing period, until they are permanently deleted.
1003
+
Any keys that you delete or replace, even they still accessible through version APIs, do not count towards your experience's storage usage. However, entire data stores deleted via the Open Cloud [`DeleteDataStore`](/cloud/reference/features/storage#Cloud_DeleteDataStore) method continue to count towards your storage usage for the duration of their 30-day processing period, until they are permanently deleted.
0 commit comments