Rate limiting in Next.js is Upstash Redis a good option?
Unanswered
Klartext posted this in #help-forum
KlartextOP
Hey,
I have a question about rate limiting in Next.js. I am building an app on Vercel and I am considering using Upstash Redis for rate limiting.
Is this currently a good and stable solution for serverless environments like Vercel or Edge Functions? Or are there better alternatives such as Cloudflare or middleware-only approaches?
I would appreciate any short experiences or recommendations.
I have a question about rate limiting in Next.js. I am building an app on Vercel and I am considering using Upstash Redis for rate limiting.
Is this currently a good and stable solution for serverless environments like Vercel or Edge Functions? Or are there better alternatives such as Cloudflare or middleware-only approaches?
I would appreciate any short experiences or recommendations.

1 Reply
Yeah, Upstash Redis is a pretty solid choice for this on Vercel. It works well in serverless/Edge setups because it’s HTTP-based, so you avoid the usual Redis connection issues.
I’d use "@upstash/ratelimit" for anything where the limit needs to be shared across instances/regions. Middleware-only/in-memory approaches are fine for very basic abuse protection, but they’re not reliable as your only limiter in serverless. Cloudflare is also great if your traffic already runs through Cloudflare, but for a Next.js app hosted on Vercel, Upstash is usually the simplest and most practical option.
I’d use "@upstash/ratelimit" for anything where the limit needs to be shared across instances/regions. Middleware-only/in-memory approaches are fine for very basic abuse protection, but they’re not reliable as your only limiter in serverless. Cloudflare is also great if your traffic already runs through Cloudflare, but for a Next.js app hosted on Vercel, Upstash is usually the simplest and most practical option.