From 57618e40fd641d218b2a2a061b1149c700bc62da Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Thu, 12 Jun 2025 17:08:32 +0100 Subject: [PATCH 1/2] Cross referencing limits for key and values to the limits page. --- src/content/docs/durable-objects/api/storage-api.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/content/docs/durable-objects/api/storage-api.mdx b/src/content/docs/durable-objects/api/storage-api.mdx index 7a7e02aa614dba8..669ecce3fc78f05 100644 --- a/src/content/docs/durable-objects/api/storage-api.mdx +++ b/src/content/docs/durable-objects/api/storage-api.mdx @@ -227,13 +227,19 @@ ctx.storage.onNextSessionRestoreBookmark(bookmark); - put(key , value , options{" "} ): - - Stores the value and associates it with the given key. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. Keys are limited to a max size of 2,048 bytes and values are limited to 128 KiB (131,072 bytes).

+ - Stores the value and associates it with the given key. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. + + The size of keys and values have different limits depending on the flavor of Durable Object you are using. Refer to either: + - [SQLite-backed Durable Object limits](/durable-objects/platform/limits/#sqlite-backed-durable-objects-general-limits) + - [KV-backed Durable Object limits](/durable-objects/platform/limits/#key-value-backed-durable-objects-general-limits).

- put(entries , options {" "}): - Takes an Object and stores each of its keys and values to storage. - Each value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. - - Supports up to 128 key-value pairs at a time. Each key is limited to a maximum size of 2,048 bytes and each value is limited to 128 KiB (131,072 bytes). + - Supports up to 128 key-value pairs at a time. The size of keys and values have different limits depending on the flavor of Durable Object you are using. Refer to either: + - [SQLite-backed Durable Object limits](/durable-objects/platform/limits/#sqlite-backed-durable-objects-general-limits) + - [KV-backed Durable Object limits](/durable-objects/platform/limits/#key-value-backed-durable-objects-general-limits) ### `delete` From e9c9c248004d1cb295ccc8846d9f25116c14b87a Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Thu, 12 Jun 2025 17:19:51 +0100 Subject: [PATCH 2/2] Update src/content/docs/durable-objects/api/storage-api.mdx Co-authored-by: Vy Ton --- src/content/docs/durable-objects/api/storage-api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/durable-objects/api/storage-api.mdx b/src/content/docs/durable-objects/api/storage-api.mdx index 669ecce3fc78f05..9b519022d854a84 100644 --- a/src/content/docs/durable-objects/api/storage-api.mdx +++ b/src/content/docs/durable-objects/api/storage-api.mdx @@ -229,7 +229,7 @@ ctx.storage.onNextSessionRestoreBookmark(bookmark); - Stores the value and associates it with the given key. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. - The size of keys and values have different limits depending on the flavor of Durable Object you are using. Refer to either: + The size of keys and values have different limits depending on the Durable Object storage backend you are using. Refer to either: - [SQLite-backed Durable Object limits](/durable-objects/platform/limits/#sqlite-backed-durable-objects-general-limits) - [KV-backed Durable Object limits](/durable-objects/platform/limits/#key-value-backed-durable-objects-general-limits).