Rate limiting.Done right.
TypeScript rate limiting with multiple strategies,
storage engines and resilience policies.
Designed fornetwork resilience.
A rate limiter should stay robust when your database is under load or temporarily unreachable. RateLock includes built-in policies like retries, circuit breakers, and local memory caching to help you handle transient errors gracefully.
Deny-Only Cache Shield
Why saturate your databases checking blacklisted IPs? RateLock caches repeatedly blocked requests in local memory, instantly rejecting malicious spikes in `0.02ms` without making a single network call.
Resilient Circuit Breaker
Avoid thread pool saturation when your databases fail. RateLock automatically halts queries, redirects calls to fail-safes, and probes recovery periodically.
Fallback Policies
Configure your limiters with custom fallback policies to guarantee that rate limit operations never throw runtime exceptions to clients during database hiccups.
Adaptive Error Policies
Choose how to handle rate limiting exceptions during extreme database congestion or downtime. Swap behaviors dynamically without rewriting controller logics.
Try it live
Interactive rate limiting simulation running entirely in your browser. Send requests, adjust parameters, and watch the limits in action.
One API,any backend.
Scale from rapid local edge nodes up to massive Postgres or Redis clusters. Swap storage backends instantly by changing a single package import.
Local
In-memory Maps, zero dependencies
Redis
Atomic Lua script pipeline execution
PostgreSQL
Isolated transactional UPSERT queries
Swap backends seamlessly,keeping code intact.
RateLock encapsulates the host-specific database driver logic inside the engine packages. Your core limiters, validation hooks, API configurations, and resilience policies remain 100% unchanged.
// Works instantly in serverless edge/lambda functions
// Swaps engine underneath. Resilience wrappers remain identical!
Drop it intoany stack.
Dedicated middlewares for pipeline frameworks, step-by-step guides for web-standard ones. Same limiters, same resilience policies, everywhere.
Numbers, not promises
Hard, reproducible numbers from the same matrix and code paths on every supported backend. Below: throughput vs. the most popular Node.js rate-limiters, and how the deny cache shields your storage layer from abuse.
Throughput Comparison
Spam Protection with Deny Cache
The withCache decorator stores blocked keys in a local, short-lived cache. Subsequent requests fail immediately in memory, preventing network round-trips to your database.
See the full benchmarks
Explore latency, throughput and memory profiles for every backend shipped with RateLock, plus the exact scripts we used to measure them.