How Truly Slow is Workers KV?

Hey team!

I’m planning on using Workers KV with one of my Workers and after reading this statement from CloudFlare’s page on limitations, I’m a bit on the fence.

“Workers KV is an eventually consistent system, meaning that reads will sometimes reflect an older state of the system. While writes will often be visible globally immediately, it can take up to 60 seconds before reads in all edge locations are guaranteed to see the new value.”

I’m planning on using a KV namespace and adding new key-values into it without ever modifying the values of any of the keys already in the namespace. I was wondering for a use-case like this if all locations are consistent pretty quickly, or if they can still take 60 seconds. I guess my question is under which circumstances does it take 60 seconds for state to be reflected on a Worker on the edge?

Also, is it slow to access keys-values within a specific namespace and then access keys-values under a different namespace, all during the same request? I plan on doing something like this to organize all of my data, but if accessing values under different namespaces turns out to be much slower, then I’ll just put all of my data under one namespace.

Thank you all so very much for all of your help!

This is a complicated question and if you need to write a value and read it, consistently, then wait for Durable Objects to come out of beta.

If you’re writing and reading from a web-browser, then you can actually write it and read it immediately as long as you have the same cloudflare cookie stored (you’ll hit the same datacenter/colo and the value will be cached until there until globally available). I’d still write logic to verify that the value has been written and can be read, to handle situations where you might not get the same datacenter or colo.

According to the waiting time, I’d say 60 seconds is a worst case scenario, example, writing in EU and reading it in China. Generally, it takes less than 10 seconds.