Videos
Is Upstash Redis free tier enough for rate limiting?
Upstash Redis Commands usage incremented even without being used
typescript - Redis operations on Vercel hang after execution when using Upstash - Stack Overflow
How does one connect to an Upstash Redis database programmatically?
» pip install upstash-redis
I'm developing a small public website for fun that makes calls to a route, which makes a few other calls to the OpenAI API, and I want to rate limit that route. I may be over-engineering a bit, but there's really nothing stopping an (anonymous) user from pasting a setInterval in their browser and spamming the API.
I've been researching for a while now and found that a lot of people have recommended Vercel KV, which I couldn't find anything updated (maybe it's deprecated?), and Upstash Redis. I tried the latter, and it was pretty easy and good, but then I realized that I had already made almost 1k out of 10k requests in the development environment in just a few hours (I use it for both caching and rate limiting), which means that eventually the API spam would affect the service anyway. Digging through the source code of the libraries, I found that there is an option to set the local cache behavior[1][2], but I'm not sure how effective it is.
For those who used the free tier, was it enough? Does Vercel have anything for free that could help, since this also affects their infrastructure?
I am a beginner in database usage and I've decided to explore my option, and landed on redis with serverless option by Upstash. I've been following along this great video by Josh tried coding
However, as I implement my code, the commands usage in the Upstash dashboard keeps on incrementing by the seconds without me making any call to the Upstash redis. It looks something like this
with SCAN, EVAL being the most used even though the operation that I'm using are `rpush`, `sadd`, `hset`. But after a while those commands usage in the dashboard resets back to 0.
Is this something i should worry about, or is it just a normal behaviour?
Cheers
» npm install @upstash/redis