Does anyone have a reference code on how to create a full export of a kv namespace? I am trying to w
Does anyone have a reference code on how to create a full export of a kv namespace? I am trying to write one myself but I am running into a lot of different issues, ranging from invalid cursors to max subrequest errors and/or inconsistent results. The kv I am testing with shows about 8.5k records in the cloudflare ui where I am already running into issues, the different production kv I will need to export will have around 144k entries so I am a bit worried about being able to export it successfully.
My use-case is that we have a kv setup with redirects (key is the original url, target url is the value of the kv record), with data imported overtime from multiple files and we now sadly lack a "master file" with all our data. So to create this masterfile I want to export the current state of the kv into a csv so that the data can be analysed by business users in excel.
14 Replies
Hi everyone, I'm new to KV and have been reading this guide. It talks about storing and serving static assets. My question is: what are the advantages of using KV for this rather than a public R2 bucket?
Well, this guide looks to be from back when Workers Sites were still a thing. You can use Assets now for free asset serving
Another thing too is that per-key RPS can scale a bit better with KV as compared to R2 + built-in caching
Like HardlyWorkin' said, there are a lot of better options than a public R2 bucket for serving static assets. Pages (https://developers.cloudflare.com/pages/) and Workers assets (https://developers.cloudflare.com/workers/static-assets/) provide hosting built for serving static sites. Using R2 and KV, while possible, would be sort of rebuilding what Pages & Workers assets do (can be valid in some cases!)
Actually, would be pretty cool to have Assets+, that could fallback to R2 instead of KV for large assets
What is the maximum limit of kv namespace for enterprise edition?
These are the official limits -> https://developers.cloudflare.com/kv/platform/limits/
Otherwise talk to your enterprise support contact you should have when you are on an enterprise plan.
Cloudflare Docs
Limits | Cloudflare Workers KV
Thanks, both.
I recently transitioned my website from Cloudflare Pages to a VPS. Currently, my Cloudflare account is only used for KV and R2 Workers, not for hosting content directly. The DMCA complaint received was for content previously hosted on Cloudflare Pages, which is no longer active there. The domain is now exclusively used for CDN purposes. Could you please confirm if the DMCA complaint still applies under this new usage?
Error: KV PUT failed: 429 Too Many Requests
what is the rate limit on put?
https://developers.cloudflare.com/kv/platform/limits/
1 write per key per second
another quick question, will put update remove the expiration if I don’t include it?
kv.put(key, value, {expiration: x}) // Create the KV pairs
kv.put(key,value2) // Update the value only
In this case, is the expiration updated?
Is anyone else seeing elevated error rates on KV puts over the last week or so?
Put won't remove the expiration if you don't include it, but it will overwrite it if you provide a new expiration
Can you share you namespace id?
I just experienced being rate-limited with the KV Namespaces Bulk Update API, with 2min 16s between the two API calls
actually being rate-limited even though the keys are different