From b05a111a0435144bba4bc062705dc793062c881d Mon Sep 17 00:00:00 2001 From: Melody Huang Date: Wed, 17 Sep 2025 17:00:59 +0200 Subject: [PATCH 1/4] Add KV access guidance and write rate limits --- src/content/docs/kv/reference/faq.mdx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/content/docs/kv/reference/faq.mdx b/src/content/docs/kv/reference/faq.mdx index d8f799524bb4314..46d33f68f045be1 100644 --- a/src/content/docs/kv/reference/faq.mdx +++ b/src/content/docs/kv/reference/faq.mdx @@ -3,10 +3,9 @@ title: FAQ pcx_content_type: faq sidebar: order: 10 - --- -import { Glossary } from "~/components" +import { Glossary } from "~/components"; Frequently asked questions regarding Workers KV. @@ -16,6 +15,13 @@ Frequently asked questions regarding Workers KV. Yes, you can use Workers KV outside of Workers by using the [REST API](/api/resources/kv/) or the associated Cloudflare SDKs for the REST API. It is important to note the [limits of the REST API](/fundamentals/api/reference/limits/) that apply. +### What are the key considerations when choosing how to access KV? + +When choosing how to access Workers KV, consider the following: + +- **Performance**: Accessing KV via the [Workers Binding API](/kv/api/write-key-value-pairs) is generally faster than using the [REST API](/api/resources/kv/), as it avoids the overhead of HTTP requests. +- **Rate Limits**: Be aware of the different rate limits for each access method. The [REST API](/api/resources/kv/) has a lower write rate limit compared to the Workers Binding API. Refer to [What is KV's write rate limits?](/kv/reference/faq/#what-is-kvs-write-rate-limit) + ### Why can I not immediately see the updated value of a key-value pair? Workers KV heavily caches data across the Cloudflare network. Therefore, it is possible that you read a cached value for up to the [cache TTL](/kv/api/read-key-value-pairs/#cachettl-parameter) duration. @@ -31,7 +37,15 @@ Refer to [How KV works](/kv/concepts/how-kv-works/). ### If a Worker makes a bulk request to Workers KV, would each individual key get counted against the [Worker subrequest limit (of 1000)](/kv/platform/limits/)? No. A bulk request to Workers KV, regardless of the amount of keys included in the request, will count as a single operation. For example, you could make -500 bulk KV requests and 500 R2 requests for a total of 1000 operations. +500 bulk KV requests and 500 R2 requests for a total of 1000 operations. + +### What is KV's write rate limit? + +KV's write rate limit differs depending on the way you access it. + +When writing to KV via the [REST API](/api/resources/kv/), the write rate limit is 1,200 writes per 5 minutes. The same [limits of the REST API](/fundamentals/api/reference/limits/) applies. + +When writing to KV via the [Workers Binding API](/kv/api/write-key-value-pairs/), the write rate limit is 1 write per second, per key, unlimited across KV keys. ## Pricing From 059630e87aeb5fd96a3712ecf9a1741e376957d0 Mon Sep 17 00:00:00 2001 From: Melody Huang Date: Wed, 17 Sep 2025 17:11:03 +0200 Subject: [PATCH 2/4] Add KV access guidance and write rate limits --- src/content/docs/kv/reference/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/kv/reference/faq.mdx b/src/content/docs/kv/reference/faq.mdx index 46d33f68f045be1..eceb4adaad537fa 100644 --- a/src/content/docs/kv/reference/faq.mdx +++ b/src/content/docs/kv/reference/faq.mdx @@ -20,7 +20,7 @@ Yes, you can use Workers KV outside of Workers by using the [REST API](/api/reso When choosing how to access Workers KV, consider the following: - **Performance**: Accessing KV via the [Workers Binding API](/kv/api/write-key-value-pairs) is generally faster than using the [REST API](/api/resources/kv/), as it avoids the overhead of HTTP requests. -- **Rate Limits**: Be aware of the different rate limits for each access method. The [REST API](/api/resources/kv/) has a lower write rate limit compared to the Workers Binding API. Refer to [What is KV's write rate limits?](/kv/reference/faq/#what-is-kvs-write-rate-limit) +- **Rate Limits**: Be aware of the different rate limits for each access method. The [REST API](/api/resources/kv/) has a lower write rate limit compared to the Workers Binding API. Refer to [What is KV's write rate limit?](/kv/reference/faq/#what-is-kvs-write-rate-limit) ### Why can I not immediately see the updated value of a key-value pair? From 484f9c7cf20484f14e47e3dfebd777047a29a392 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Thu, 18 Sep 2025 09:26:10 +0100 Subject: [PATCH 3/4] PCX Review --- src/content/docs/kv/reference/faq.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/kv/reference/faq.mdx b/src/content/docs/kv/reference/faq.mdx index eceb4adaad537fa..e736e32f650467b 100644 --- a/src/content/docs/kv/reference/faq.mdx +++ b/src/content/docs/kv/reference/faq.mdx @@ -19,8 +19,8 @@ Yes, you can use Workers KV outside of Workers by using the [REST API](/api/reso When choosing how to access Workers KV, consider the following: -- **Performance**: Accessing KV via the [Workers Binding API](/kv/api/write-key-value-pairs) is generally faster than using the [REST API](/api/resources/kv/), as it avoids the overhead of HTTP requests. -- **Rate Limits**: Be aware of the different rate limits for each access method. The [REST API](/api/resources/kv/) has a lower write rate limit compared to the Workers Binding API. Refer to [What is KV's write rate limit?](/kv/reference/faq/#what-is-kvs-write-rate-limit) +- **Performance**: Accessing Workers KV via the [Workers Binding API](/kv/api/write-key-value-pairs/) is generally faster than using the [REST API](/api/resources/kv/), as it avoids the overhead of HTTP requests. +- **Rate Limits**: Be aware of the different rate limits for each access method. [REST API](/api/resources/kv/) has a lower write rate limit compared to Workers Binding API. Refer to [What is KV's write rate limit?](/kv/reference/faq/#what-is-the-rate-limit-of-workers-kv) ### Why can I not immediately see the updated value of a key-value pair? @@ -39,13 +39,13 @@ Refer to [How KV works](/kv/concepts/how-kv-works/). No. A bulk request to Workers KV, regardless of the amount of keys included in the request, will count as a single operation. For example, you could make 500 bulk KV requests and 500 R2 requests for a total of 1000 operations. -### What is KV's write rate limit? +### What is the rate limit of Workers KV? -KV's write rate limit differs depending on the way you access it. +Workers KV's write rate limit differs depending on the way you access it. -When writing to KV via the [REST API](/api/resources/kv/), the write rate limit is 1,200 writes per 5 minutes. The same [limits of the REST API](/fundamentals/api/reference/limits/) applies. +When writing to Workers KV via the [REST API](/api/resources/kv/), the write rate limit is 1,200 writes per 5 minutes. The same [limits of the REST API](/fundamentals/api/reference/limits/) applies. -When writing to KV via the [Workers Binding API](/kv/api/write-key-value-pairs/), the write rate limit is 1 write per second, per key, unlimited across KV keys. +When writing to Workers KV via the [Workers Binding API](/kv/api/write-key-value-pairs/), the write rate limit is 1 write per second, per key, unlimited across KV keys. ## Pricing From ac3919afae7354849f87bfd1bc323380230e7e4e Mon Sep 17 00:00:00 2001 From: Melody Huang Date: Thu, 18 Sep 2025 14:10:27 +0200 Subject: [PATCH 4/4] Clarify KV operations bound by REST API limits --- src/content/docs/kv/reference/faq.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/kv/reference/faq.mdx b/src/content/docs/kv/reference/faq.mdx index e736e32f650467b..182dfd19f5914da 100644 --- a/src/content/docs/kv/reference/faq.mdx +++ b/src/content/docs/kv/reference/faq.mdx @@ -20,7 +20,7 @@ Yes, you can use Workers KV outside of Workers by using the [REST API](/api/reso When choosing how to access Workers KV, consider the following: - **Performance**: Accessing Workers KV via the [Workers Binding API](/kv/api/write-key-value-pairs/) is generally faster than using the [REST API](/api/resources/kv/), as it avoids the overhead of HTTP requests. -- **Rate Limits**: Be aware of the different rate limits for each access method. [REST API](/api/resources/kv/) has a lower write rate limit compared to Workers Binding API. Refer to [What is KV's write rate limit?](/kv/reference/faq/#what-is-the-rate-limit-of-workers-kv) +- **Rate Limits**: Be aware of the different rate limits for each access method. [REST API](/api/resources/kv/) has a lower write rate limit compared to Workers Binding API. Refer to [What is the rate limit of Workers KV?](/kv/reference/faq/#what-is-the-rate-limit-of-workers-kv) ### Why can I not immediately see the updated value of a key-value pair? @@ -41,9 +41,9 @@ No. A bulk request to Workers KV, regardless of the amount of keys included in t ### What is the rate limit of Workers KV? -Workers KV's write rate limit differs depending on the way you access it. +Workers KV's rate limit differs depending on the way you access it. -When writing to Workers KV via the [REST API](/api/resources/kv/), the write rate limit is 1,200 writes per 5 minutes. The same [limits of the REST API](/fundamentals/api/reference/limits/) applies. +Operations to Workers KV via the [REST API](/api/resources/kv/) are bound by the same [limits of the REST API](/fundamentals/api/reference/limits/). This limit is shared across all Cloudflare REST API requests. When writing to Workers KV via the [Workers Binding API](/kv/api/write-key-value-pairs/), the write rate limit is 1 write per second, per key, unlimited across KV keys.