Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. ex_rated

ex_rated

NOASSERTIONElixirv2.1.0

An Elixir OTP GenServer that implements a token bucket algorithm for rate limiting calls to external APIs or services.

GitHubGitHub
460 stars51 forks0 contributors

What is ex_rated?

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.

Target Audience

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.

Value Proposition

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.

Overview

ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it.

Use Cases

Best For

  • Enforcing rate limits on external API calls in Elixir applications to prevent exceeding third-party quotas.
  • Building rate-limiting plugs for Phoenix APIs to control request frequency from clients.
  • Managing resource usage in concurrent Elixir systems where multiple services need separate rate limit buckets.
  • Implementing token bucket rate limiting with configurable time scales and limits for various operational scenarios.
  • Persisting rate limit data across server restarts in stateful Elixir applications using the DETS option.
  • High-performance applications requiring millions of rate limit checks quickly, such as real-time data processing systems.

Not Ideal For

  • Distributed applications requiring rate limiting across multiple nodes, as ExRated is a single-node GenServer without built-in clustering.
  • Projects needing complex rate limiting strategies beyond token bucket, such as sliding windows or leaky bucket algorithms.
  • Teams looking for out-of-the-box integration with non-Phoenix web frameworks or extensive monitoring dashboards.

Pros & Cons

Pros

Blazing Fast Performance

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.

Simple and Intuitive API

Provides minimal functions like check_rate, inspect_bucket, and delete_bucket, making integration straightforward without unnecessary complexity, as seen in the usage examples.

Flexible Bucket Management

Supports unlimited named buckets with configurable scales and limits, enabling different rate limiting scenarios per service, and includes manual deletion and inspection features.

OTP Reliability

Built as an OTP GenServer, ensuring robustness and scalability in concurrent Elixir environments, with options for persistence via DETS for server restarts.

Cons

Single-Node Limitation

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.

Algorithm Inflexibility

Strictly implements the token bucket algorithm without support for other common methods like sliding windows, limiting its applicability for diverse rate limiting needs.

Manual Configuration Overhead

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.

Frequently Asked Questions

Quick Stats

Stars460
Forks51
Contributors0
Open Issues1
Last commit3 years ago
CreatedSince 2014

Tags

#elixir#bucket#api#phoenix#otp#token-bucket#api-client#rate-limiting#concurrency#rate-limit#rate#performance

Built With

E
ETS
G
GenServer
E
Elixir
O
OTP

Included in

Elixir13.1k
Auto-fetched 1 day ago

Related Projects

porcelainporcelain

Work with external processes like a boss

Stars960
Forks45
Last commit5 years ago
hammerhammer

An Elixir rate-limiter with pluggable backends

Stars914
Forks47
Last commit4 days ago
cubdbcubdb

Elixir embedded key/value database

Stars650
Forks33
Last commit1 year ago
AlloyCIAlloyCI

Continuous Integration, Deployment, and Delivery coordinator, written in Elixir.

Stars289
Forks10
Last commit3 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub