Hi folks, I have a question, I came from traditional Node.js Express REST apis that caches with mysq
Hi folks, I have a question, I came from traditional Node.js Express REST apis that caches with mysql database data with Redis, so I don't know if I understand KV well, but it's like Redis and is good to use it to cache database list results for performance improvement, or is D1 enough for this purpose? Or the purpose of KV is cache the entire response from a Worker?
18 Replies
I know it isn't many reads, but man when KV is doing hot only reads it is fast
Hlo
hey there - has the behavior with KV changed recently? we are getting KV hits for deleted key-pairs
some context:
- the key has a cacheTTL of 24h
- we delete the key through the REST API
- the key is not in the KV if i prefix search the key on the dashbaord
- a console.log() after the read in the worker still finds the old row
so I'm thinking either the delete is just taking longer than usual to propagate, or maybe something's changed, cause iirc we got a miss here previously
how can I delete a key ? I just saw in the doc the method put and get
i have 2 questions, full disclosure: i don't understand back end infrastructure too well
1# is kv as secure as d1? like can i store emails as keys on it? is that a good idea?? or will ANYONE be able to retrieve that info? the docs seem to imply it's fairly secure i think
2# how quick are updates if i write into kv? will that happen under 30 mins and be reflected everywhere?
if info about my use case is needed, i want to store a list of digital item's urls or ids (which i will fetch with ajax on client side)
stored as "email (who purchased) : json (nested list of items purchased)"
originally i thought user sign in sign up would be neat but i don't want the responsibility of storing passwords or anything for something as simple as "hey did the user purchase this product fully?", specially because payments will be handled face to face, not digitally and i will have to input emails and purchase list by hand anyway. i think getting email from google sign in or something then fetching the key : value pair seems reasonable and simple to me
1. No one can ever read another persons resources without explicitly being allowed by that person
So, no. No one can read your KV unless you explicitly create like an API for them to do so
2. It takes up to 60 seconds for new values to be reflected
thanks!
By #1 the caveat is that KV values can be viewed on the dashboard, but as Walshy said, they'd need access to your Cloudflare account to do that.
as long as it's not publicly available like static websites, that's all good yes thanks
DNS over Discord: GitHub
View the DNS over Discord source code on GitHub at https://dns-over-discord.v4.wtf/github
is this too much for KV read ops?
data is a json 30KB
testing after read: https://blog.cloudflare.com/faster-workers-kv/
this is string value of 1KB. That's a lots
Yeah that's abnormal
I was skeptical till you sent that second image lol
and mixed-data
Never reach any lower than 100ms
Where's your nearest PoP?
all requests (chart) come from around the world
My local dev is near Singapore (SIN)
Okay cool so not localised, absolutely abnormal
I admit that more a half are cold reads, but compare to … CDN cache read? That’s too much for KV