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
Limits for individual queries (listed above) apply to each individual statement contained within a batch statement. For example, the maximum SQL statement length of 100 KB applies to each statement inside a `db.batch()`.
32
32
:::
33
33
34
34
[^1]: The maximum storage per account can be increased by request on Workers Paid and Enterprise plans. See the guidance on limit increases on this page to request an increase.
35
-
36
35
[^2]: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, KV namespace, environmental variable or secret. Each resource binding is approximately 150-bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.
37
-
38
36
[^3]: Requests to Cloudflare API must resolve in 30 seconds. Therefore, this duration limit also applies to the entire batch call.
39
-
40
37
[^4]: The imported file is uploaded to R2. See [R2 upload limit](/r2/platform/limits).
41
38
39
+
<Detailsheader="Footnotes"open={true}>
40
+
1: The maximum storage per account can be increased by request on Workers Paid and Enterprise plans. See the guidance on limit increases on this page to request an increase.
41
+
42
+
2: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, KV namespace, environmental variable or secret. Each resource binding is approximately 150 bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.
43
+
44
+
3: Requests to Cloudflare API must resolve in 30 seconds. Therefore, this duration limit also applies to the entire batch call.
45
+
46
+
4: The imported file is uploaded to R2. See [R2 upload limit](/r2/platform/limits).
47
+
</Details>
48
+
42
49
Cloudflare also offers other storage solutions such as [Workers KV](/kv/api/), [Durable Objects](/durable-objects/), and [R2](/r2/get-started/). Each product has different advantages and limits. Refer to [Choose a data or storage product](/workers/platform/storage-options/) to review which storage option is right for your use case.
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/platform/limits.mdx
+20-11Lines changed: 20 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,19 @@ Durable Objects are a special kind of Worker, so [Workers Limits](/workers/platf
24
24
| WebSocket message size | 1 MiB (only for received messages) |
25
25
| CPU per request | 30 seconds (default) / configurable to 5 minutes of [active CPU time](/workers/platform/limits/#cpu-time)[^4]|
26
26
27
+
[^1]: Identical to the Workers [script limit](/workers/platform/limits/).
28
+
[^2]: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
29
+
[^3]: Accounts on the Workers Free plan are limited to 5 GB total Durable Objects storage.
30
+
[^4]: Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
31
+
27
32
<Detailsheader="Footnotes"open={true}>
28
-
1: Identical to the Workers [script limit](/workers/platform/limits/)
33
+
1. Identical to the Workers [script limit](/workers/platform/limits/).
29
34
30
-
2: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
35
+
2. Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
31
36
32
-
3: Accounts on the Workers Free plan are limited to 5GB total Durable Objects storage.
37
+
3. Accounts on the Workers Free plan are limited to 5GB total Durable Objects storage.
33
38
34
-
4: Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
39
+
4. Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
35
40
</Details>
36
41
37
42
### SQL storage limits
@@ -55,21 +60,25 @@ For Durable Object classes with [SQLite storage](/durable-objects/api/storage-ap
55
60
| Feature | Limit for class with key-value storage backend |
| Storage per account | 50 GB (can be raised by contacting Cloudflare) [^6]|
60
65
| Storage per class | Unlimited |
61
66
| Storage per Durable Object | Unlimited |
62
67
| Key size | 2 KiB (2048 bytes) |
63
68
| Value size | 128 KiB (131072 bytes) |
64
69
| WebSocket message size | 1 MiB (only for received messages) |
65
-
| CPU per request | 30s (including WebSocket messages) [^3]|
70
+
| CPU per request | 30s (including WebSocket messages) [^7]|
71
+
72
+
[^5]: Identical to the Workers [script limit](/workers/platform/limits/).
73
+
[^6]: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
74
+
[^7]: Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
66
75
67
-
<Detailsheader="Footnotes">
68
-
1: Identical to the Workers [script limit](/workers/platform/limits/)
76
+
<Detailsheader="Footnotes"open={true}>
77
+
5. Identical to the Workers [script limit](/workers/platform/limits/).
69
78
70
-
2: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
79
+
6. Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
71
80
72
-
3: Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
81
+
7. Each incoming HTTP request or WebSocket *message* resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
Copy file name to clipboardExpand all lines: src/content/docs/workers/platform/storage-options.mdx
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ head:
9
9
description: Storage and database options available on Cloudflare's developer platform.
10
10
---
11
11
12
-
import { Render } from"~/components";
12
+
import { Render, Details } from"~/components";
13
13
14
14
Cloudflare Workers support a range of storage and database options for persisting different types of data across different use-cases, from key-value stores (like [Workers KV](/kv/)) through to SQL databases (such as [D1](/d1/)). This guide describes the use-cases suited to each storage option, as well as their performance and consistency properties.
15
15
@@ -44,24 +44,34 @@ The following table highlights the performance and consistency characteristics o
| Maximum size per value | 25 MiB | 5 TiB per object | 128 KiB per value | 10 GiB per database <sup>4</sup>|
50
-
| Consistency model | Eventual: updates take up to 60s to be reflected | Strong (read-after-write)<sup>5</sup>| Serializable (with transactions) | Serializable (no replicas) / Causal (with replicas) |
49
+
| Maximum size per value | 25 MiB | 5 TiB per object | 128 KiB per value | 10 GB per database [^5]|
50
+
| Consistency model | Eventual: updates take up to 60s to be reflected | Strong (read-after-write)[^6]| Serializable (with transactions) | Serializable (no replicas) / Causal (with replicas) |
51
51
| Supported APIs | Workers, HTTP/REST API | Workers, S3 compatible | Workers | Workers, HTTP/REST API |
52
52
53
53
</table-wrap>
54
54
55
-
<sup>1</sup> Free accounts are limited to 1 GiB of KV storage.
55
+
[^1]: Free accounts are limited to 1 GiB of KV storage.
56
+
[^2]: Free accounts are limited to 10 GB of R2 storage.
57
+
[^3]: Free accounts are limited to 5 GB of storage for SQLite-backed Durable Objects. 50 GB limit applies for KV-backed Durable Objects. Refer to [Durable Objects limits](/durable-objects/platform/limits/).
58
+
[^4]: Free accounts are limited to 5 GB of database storage.
59
+
[^5]: Free accounts are limited to 500 MB per database.
60
+
[^6]: Refer to the [R2 documentation](/r2/reference/consistency/) for more details on R2's consistency model.
56
61
57
-
<sup>2</sup> Free accounts are limited to 10 GB of R2 storage.
62
+
<Detailsheader="Footnotes"open={true}>
63
+
1. Free accounts are limited to 1 GiB of KV storage.
58
64
59
-
<sup>3</sup> Free accounts are limited to 5 GiB of database storage.
65
+
2. Free accounts are limited to 10 GB of R2 storage.
60
66
61
-
<sup>4</sup> Free accounts are limited to 500 MiB per database.
67
+
3. Free accounts are limited to 5 GB of storage for SQLite-backed Durable Objects. 50 GB limit applies for KV-backed Durable Objects. Refer to [Durable Objects limits](/durable-objects/platform/limits/).
62
68
63
-
<sup>5</sup> Refer to the [R2 documentation](/r2/reference/consistency/) for
64
-
more details on R2's consistency model.
69
+
4. Free accounts are limited to 5 GB of database storage.
70
+
71
+
5. Free accounts are limited to 500 MB per database.
72
+
73
+
6. Refer to the [R2 documentation](/r2/reference/consistency/) for more details on R2's consistency model.
0 commit comments