Application-level TypeScript rate limiting

Upstash Ratelimit

An MIT-licensed TypeScript rate-limiting library for serverless and edge runtimes, commonly backed by Upstash Redis-compatible state.

Editorial verdict

Choose Upstash Ratelimit when TypeScript application context should own the quota and a Redis-backed library fits the latency, consistency, availability, and cost boundary.12

Best for

  • TypeScript serverless and edge handlers
  • Product-aware application quotas
  • Teams wanting a small library boundary
12

Not ideal for

  • Fleet-wide gateway policy
  • Traffic that must be stopped before application execution
  • Teams unwilling to own identifiers and failure policy
12
Main trade-off

Application-level control improves product context while adding library, state-service, latency, consistency, failover, and usage-cost dependencies.12

Product boundary

Whether quota policy should live in TypeScript application code with a managed low-operations state dependency.

Upstash Ratelimit is an application library, not a managed gateway or WAF. The application owns identifiers, policy, trust boundaries, fail-open or fail-closed behavior, responses, and bypass paths; backing Redis commands, regions, latency, consistency, and availability remain separate.12

For: JavaScript and TypeScript teams implementing explicit quotas in serverless or edge request paths

  • Quota must be enforced at a shared gateway
  • The Redis-backed latency or consistency model does not fit
  • The team cannot own fail-open, policy-key, and bypass behavior

Why teams consider Upstash Ratelimit

  • Application contextPolicy can use user, tenant, plan, endpoint, or product-specific identifiers.12
  • Serverless fitThe HTTP-based library is documented for several serverless and edge runtimes.12
  • Algorithm optionsThe library exposes fixed, sliding, token, caching, timeout, and multi-limit behaviors.12

Pricing

The MIT-licensed library has no separate subscription; total cost comes from backing Redis commands, storage, bandwidth, regions, production add-ons, hosting, and engineering operations.2

Current decision boundary

Open-source library plus backing state

Verified 2026-07-27: the library is MIT-licensed; Upstash Redis publishes Free, pay-as-you-go, Fixed, production add-on, and Enterprise cost boundaries.2

Library fee
No separate Upstash Ratelimit subscription2
Primary managed meter
Redis commands, storage, bandwidth, regions, and plan2
Application duty
Identifiers, algorithms, failure mode, responses, bypasses, and observability2
Pricing checked View official pricing

Upstash Ratelimit vs alternatives

Cloudflare Rate Limiting

Choose when
Early edge enforcement
Avoid when
Product quotas requiring private application state
Compared with Upstash Ratelimit
Edge enforcement protects origins early while accepting Cloudflare rule semantics, plan gates, observability, false-positive risk, and bypass considerations.34

Kong Gateway

Choose when
Shared API gateway policy
Avoid when
One small application limiter
Compared with Upstash Ratelimit
Central policy reduces service duplication while adding gateway availability, configuration, edition, storage, plugin, data-plane, and migration responsibilities.56

Envoy

Choose when
Existing Envoy data planes
Avoid when
Turnkey managed rate limiting
Compared with Upstash Ratelimit
Proxy-level flexibility increases control while transferring correctness, state, rollout, resilience, observability, capacity, and upgrades to the platform team.78

Resources and sources

Official product, pricing, policy, and operating sources

  • Upstash Ratelimit overview
    Open
  • Upstash Redis pricing
    Open
  • Cloudflare rate-limiting rules
    Open
  • Cloudflare application services plans
    Open
  • Kong Gateway rate limiting
    Open
  • Kong pricing
    Open
  • Envoy rate-limit filter
    Open
  • Envoy repository and license
    Open
  1. 1
    Upstash Ratelimit overview

    Upstash · Accessed Official

  2. 2
    Upstash Redis pricing

    Upstash · Accessed Official

  3. 3
    Cloudflare rate-limiting rules

    Cloudflare · Accessed Official

  4. 4
    Cloudflare application services plans

    Cloudflare · Accessed Official

  5. 5
    Kong Gateway rate limiting

    Kong · Accessed Official

  6. 6
    Kong pricing

    Kong · Accessed Official

  7. 7
    Envoy rate-limit filter

    Envoy · Accessed Official

  8. 8
    Envoy repository and license

    Envoy · Accessed Official