FAQ
Frequently asked questions regarding Workers KV.
Yes, you can use Workers KV outside of Workers by using the REST API or the associated Cloudflare SDKs for the REST API. It is important to note the limits of the REST API that apply.
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 duration.
Workers KV is eventually consistent.
Workers KV stores data in central stores and replicates the data to all Cloudflare locations through a hybrid push/pull replication approach. This means that the previous value of the key-value pair may be seen in a location for as long as the cache TTL. This means that Workers KV is eventually consistent.
Refer to How KV works.
When writing via Workers KV's REST API, how are writes charged?
Each key-value pair in the PUT
request is counted as a single write, identical to how each call to PUT
in the Workers API counts as a write. Writing 5,000 keys via the REST API incurs the same write costs as making 5,000 PUT
calls in a Worker.
Yes, any operations via the Cloudflare dashboard or wrangler, including updating (writing) keys, deleting keys, and listing the keys in a namespace count as billable Workers KV usage.
No.