After some researches, I haven’t found answers to some questions, any help, even only for one question, will be really appreciated !
The listing feature seems to works with ‘cursor’. So, imagine we have 100.000 keys we would like to list, but want to show the 99.000’s key, this mean we need to call the KV list function 99 times and to follow the cursor ? I’m afraid this take more than 1 second to run 99 times the list function, and this will also cost very much (as the payment is based on the number of listing call I supposed)
To increase performances and reduce costs, may be we can store in KV each cursors IDs, so, next time we want the 99 page, we can use the associated cursor. But is this cursor ID expire/change ? Is it safe to re-use it even many days after ?
If the cursor ID could change, when this happen ? I suppose when new keys have been created ?
Could we use different namespaces KV inside the same worker function ?
How fast is it to retrieve a key of 10MB ? (milliseconds or more?)
How fast is it to store a key of 10MB ? (milliseconds or more?)
We don’t make any specific guarantees around how long cursors last.
Can we have an idea of the approximate time where it’s safe to re-use ? is it about seconds, minutes, hours, days ?
Yes, but don’t forget that you can use a prefix to cut down on the number of keys. It really depends on exactly what you’re doing.
In our case, it’s to do a listing of products (~ 2 millions ), and to manage pagination from KV, but if the user is on page 1 and want the page 99, this mean 99 calls of the “listing” function (really expensive, except if we could keep in KV the last cursor ID of this page 99, to re-use it later )
This really depends on a number of things, like hot/cold keys, if you’re doing it from in a worker or via the API, etc.
Yes, all that stuffs will be done in your Workers. A big JSON of 10MB in KV, to decode, and to use on most of the Workers requests (so in theory a hot key, but may be it’s depend of the traffic/audience). So if we could have precision of this is possible or if there is too much delay/limitations ?
while you’ll found time to answer previous message, if you could also reply to this question, this will be really appreciate:
For another project, one of our client have a e-commerce website, with ~100 websites domains for regional SEO reasons (domain name in the language of the country with the associated ccTLDs).
Technically, it’s exactly the same web server, the same code, the same DB. On each request, the code extract from the header the hostname to adjust the returned response in the good language.
If we migrate to Workers KV for this project, is it possible to have one Workers + KV price, and to link the 99 others domains to uses this worker/KV and then to not pay x100 the CF service ? ($500/month)