A Go library providing distributed rate limiting algorithms with pluggable backends and locks for scalable applications.
Limiters is a Go library that provides a collection of distributed rate limiting algorithms for scalable applications. It enables developers to enforce rate limits consistently across distributed systems by offering configurable backends and distributed locks. The library supports various algorithms like Token Bucket, Leaky Bucket, and Sliding Window Counter, decoupling rate limiting logic from storage and locking mechanisms.
Go developers building scalable distributed applications, such as microservices or APIs, that require consistent rate limiting across multiple instances. It is also suitable for developers needing flexible backend integrations with systems like Redis, DynamoDB, or etcd.
Developers choose Limiters for its flexibility in supporting multiple rate limiting algorithms and pluggable backends, allowing easy integration with existing infrastructure. Its unique selling point is the decoupling of rate limiting logic from storage and locking, providing reliability and thread safety in distributed environments without vendor lock-in.
Golang rate limiters for distributed applications
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers multiple rate limiting algorithms including Token Bucket, Leaky Bucket, and Sliding Window, allowing developers to select the best fit based on precision and resource needs, as detailed in the README's feature list.
Supports a wide range of backends from in-memory to cloud databases like DynamoDB and Cosmos DB, enabling seamless integration with existing infrastructure without vendor lock-in, as emphasized in the pluggable architecture.
Integrates with distributed locks via etcd, Consul, and others, ensuring thread-safe and consistent rate limiting across distributed instances, which is core to the library's philosophy for scalable applications.
Provides real-world examples like gRPC interceptors and IP-based limiters, helping developers implement rate limiting quickly, as shown in the gRPC and DynamoDB sections of the README.
The README explicitly states that Memcached is not ideal for reliable locks or data persistence due to eviction issues, which can lead to unexpected behavior and data loss in distributed systems.
Backends like DynamoDB and Cosmos DB require manual table or container creation with specific schemas and TTL settings, adding configuration steps that can be cumbersome for quick deployments, as noted in the DynamoDB and Cosmos DB sections.
Algorithms like Token Bucket and Leaky Bucket necessitate distributed locks, creating a dependency on external services that can fail, increasing system complexity and potential points of failure.
Algorithms like Sliding Window Counter use twice the memory of Fixed Window, which might be a concern in memory-constrained environments, as mentioned in the algorithm descriptions.