An Elixir OTP GenServer that implements a token bucket algorithm for rate limiting calls to external APIs or services.
ExRated is an Elixir library that provides fast, efficient rate limiting for services and API calls. It implements a token bucket algorithm as an OTP GenServer, allowing developers to prevent excessive requests and manage resource usage. The library supports multiple named buckets, high-performance operations, and optional persistence to disk.
Elixir developers building applications that need to enforce rate limits on external API calls or internal services, particularly those using the Phoenix framework who require a plug for API rate limiting.
Developers choose ExRated for its high performance (benchmarked under 1 microsecond per operation), simplicity, and adherence to Elixir/OTP conventions for reliability in concurrent environments. It offers a minimal yet powerful interface without unnecessary complexity.
ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it.
Benchmarks show execution times under 1 microsecond per operation, capable of handling millions of checks quickly, as demonstrated in the performance tests on a Macbook Pro.
Provides minimal functions like check_rate, inspect_bucket, and delete_bucket, making integration straightforward without unnecessary complexity, as seen in the usage examples.
Supports unlimited named buckets with configurable scales and limits, enabling different rate limiting scenarios per service, and includes manual deletion and inspection features.
Built as an OTP GenServer, ensuring robustness and scalability in concurrent Elixir environments, with options for persistence via DETS for server restarts.
Designed for single-node use, so it cannot handle distributed rate limiting across clusters without custom workarounds, which is a significant drawback for scalable systems.
Strictly implements the token bucket algorithm without support for other common methods like sliding windows, limiting its applicability for diverse rate limiting needs.
Requires setup of ETS tables and periodic pruning, with breaking changes in updates (e.g., v2.0.0), adding maintenance complexity compared to more automated solutions.
Work with external processes like a boss
An Elixir rate-limiter with pluggable backends
Elixir embedded key/value database
Continuous Integration, Deployment, and Delivery coordinator, written in Elixir.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.