Videos
Is Upstash Redis free tier enough for rate limiting?
Upstash Redis
Lack of transactions in Upstash Redis REST api, potential fixes? : redis
Upstash Redis Commands usage incremented even without being used
» 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?
» npm install @upstash/redis