Why should I use Workers KV instead of a .json file served via CDN?

“In short, Workers KV remains the best way to serve static content, configuration, and other rarely-changing data around the world.” - source - I can do that stuff with .json files too

So:
storing a 2MB .json file costs basically nothing, Cloudflare CDN for that json file is completely free. So reading and writing that .json file is completely free.
On the other hand:
Workers KV has a ugly pricing. 50ct for a million reads, and $5 for a million writes. That’s really expensive.

So, what reasons are there to use Workers KV? I just want to understand the use case of Workers KV, because I think I misunderstood something or don’t get something. Because I really can’t understand why people shall use Workers KV instead of a basic .json file served for free via CDN.

thanks a lot!!

Workers is a serverless application that is hosted on CF edge, it can be used for a lot of different projects, imagination is the bottleneck here.

For example, I have been told that some enterprise customers use workers to modify the prices shown to the bots, making products more expensive for the automated traffic.
I’m sure there are people more skilled than I am than can share some of their projects with workers, you can also take a peek at cf blog where they share some of the things you can build with workers.

1 Like

Worker KV is one of the ways to read and write data within Cloudflare Edge. You can read from a JSON file with your worker, but a write is not persistent.

storing a 2MB .json file costs basically nothing, Cloudflare CDN for that json file is completely free. So reading and writing that .json file is completely free.

Where are you storing your JSON? KVs values can be JSONs too.

1 Like