Atomic and non-atomic counters and rate limiting tools for Node.js, Deno, and browsers to protect from DoS and brute force attacks.
rate-limiter-flexible is a Node.js and Deno library for implementing rate limiting and atomic counters to protect applications from denial-of-service (DoS) and brute force attacks. It provides a flexible, high-performance solution that works with multiple storage backends and supports various rate limiting strategies. The library helps control resource access by limiting the number of requests or events over a specified duration.
Backend developers and DevOps engineers building scalable Node.js or Deno applications that require robust rate limiting, API protection, or distributed counter functionality. It's also suitable for developers integrating with frameworks like Express, Koa, NestJS, or GraphQL.
Developers choose rate-limiter-flexible for its atomic operations that prevent race conditions, support for numerous databases and stores, high performance, and flexible strategies like in-memory blocking and insurance failover. Its unified API and framework integrations make it easy to adopt and scale.
Atomic and non-atomic counters and rate limiting tools. Limit resource access at any scale.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports over 10 backends including Valkey, Redis, Prisma, and DynamoDB, providing flexibility for any infrastructure as listed in the README.
Uses atomic increments to prevent race conditions in distributed environments, ensuring reliability as emphasized in the library's philosophy.
Claims average request times of 0.7ms in Cluster and 2.5ms in distributed apps, with benchmarks referenced in the README for validation.
Offers strategies like in-memory blocking, insurance failover, and burst support, detailed in the Wiki for handling extreme attack scenarios.
Includes ready-made middleware for Express, Koa, NestJS, and others, simplifying integration into existing Node.js applications.
Requires manual setup of storage clients and numerous options for each backend, which can be time-consuming compared to simpler, drop-in solutions.
Full documentation is hosted on a separate Wiki, making it harder to find all information in one place, as noted in the README's links.
Advanced features like Insurance Strategy and Block Strategy require understanding specific concepts, which might be overkill for basic rate limiting needs.