KV has enough traffic everywhere that I don’t think you’re going to see cold loads of its worker
KV has enough traffic everywhere that I don’t think you’re going to see cold loads of its worker
Worker(?) that interfaces with KV?
Due to the eventually consistent nature of Workers KV, concurrent writes can end up overwriting one another. It is a common pattern to write data from a single process via Wrangler or the API. This avoids competing, concurrent writes because of the single stream. All data is still readily available within all Workers bound to the namespace.
Writes are immediately visible to other requests in the same global network location, but can take up to 60 seconds to be visible in other parts of the world. Refer to How KV works for more information on this topic.This section is a bit vague at best, and at worst, conflicts with the "How KV Works" page.
Initial reads from a location do not have a cached value. The data must be read from the nearest central data store, resulting in a slower response.
.put ever "fail"? If so, what does it look like?.put docs it says:This method returns a Promise that you should await on in order to verify a successful update.Does this mean I should expect an error if it fails? Or set it up with a
.catch or something?Does this mean "concurrent writes to the same key"? Or just concurrent writes to any keys in general?Same key, you can write to different keys, not affected by that
Which is it?It's both, I don't see how those conflict, the first statement is a bit vague though. Writes update local colo (location) cache. If you write to ORD (Chicago), any KV Requests for that same key in Chicago will see the updated key instantly. If you had requested that key in EWR (Newark) recently enough that it is still in cache, it can take a minute or so to update to that new value, depending on when you fetched it. If you had never fetched that key from LHR, then a request frrom lhr would hit one of the central data stores and see the updated value instantly.
Question 3:
KV PUT failed: 414 UTF-8 encoded length of 1064 exceeds key length limit of 512.404s when trying to access data that was just created.. but only sometimes.get will be null if that key doesn't exist.
.put.put.catchKV PUT failed: 414 UTF-8 encoded length of 1064 exceeds key length limit of 512.404getenv.NAMESPACE.get(['foo', 'bar', 'bang'])