this is terrible.
kv update globally at 30s is very very long.
anyways to force the node at one single datacenter? that should make it locally at 0.5s if not mistaken or sooner.
e.g. something.something.workers.dev <- pls use only datacenter nearest to london location
actually i need it to be closest to the primary datastore location, i think that’s in US
i understand. but i just need it at 1s or below. coz 30s is really too long. any other solutions that the one i suggested? any ways to force it to go only to the nearest data center?
else would it help if i have a US server that communicates with cloudflare workers? that should make it local right? and within 0.5s
i will write the US local server as a proxy to cloudflare workers
i think i will write the US local server as a proxy to cloudflare workers then. that should help a lot if not solve this issue. i think the local server will always do 0.5s max if not mistaken.
i’ve gotten consistently 10ms response of updates locally on KV store
cloudflare serve the closest origin so the KV used on cloudflare workers will always be updated on the closest node first then propagate globally. i just need something that’s below 0.5s update will do from 1 location.
user -> US server -> cloudflare workers
this should get me consistent 0.5s updated KV values.
There’s no guarantees for which datacenter or worker instance the network will choose, you can get 10 different ones even when connecting from the same location.
Documentation says KV takes up to 60 seconds to be globally consistent.
Changes may take up to 60 seconds to propagate
Cloud Storage = 0s
If you need a global strongly consistent store you probably want to look into Google Cloud Storage, which uses bits of Google Spanner since 2018 :
Cloud Storage now provides strong consistency
…With one big drawback: Google Cloud is unaccessible from China.
Edge caches : 10s
Not tested, but I was asking myself the same question:
If you need to stick with KV Storage because China, you might try to reduce the consistency lag to 10 seconds.
When you write in KV, use Cloudflare API to cache the data in all your Cloudflare Edge CDN, so they all will be warmed, and consistency will be achieved in 10s. Just like a regular deployment.
Check the source code of wrangler to see how a deployment works.
I’ve been dealing a lot with China market and servers and in todays political climate - I’d not consider any US-based cloud service for building anything serious. I’d just get servers on Ali Cloud, there’s not many reliable alternatives.