Measurements made in browser
Workers KV API calls from a worker :
- Put : 1.25 seconds
- Get : 1.14 seconds
- Del : 1.28 seconds
Workers KV Bindings calls from a worker :
- Put : 53 milliseconds
- Get : 28 milliseconds
- Del : 14 milliseconds
- Binding performance is OK
- API calls should be avoided
This is known and it’s due to how those work. The API goes back to the central server, the bindings are cached locally in the same POP where the worker is running.
So you’re saying, with bindings, the write is made on the edge store, then replicated later on the central store ?
.del() you could use
Yes, it could accelerate even more the thing !
That’s why you can do an immediate KW write and read in same worker request and the read will still be reliably instant.
Exactly. Later meaning a max of 60s (usually much much lower, basically API time), being an eventually consistent KV store.