All Projects → vladimir-bukhtoyarov → Bucket4j

vladimir-bukhtoyarov / Bucket4j

Licence: apache-2.0
Java rate limiting library based on token/leaky-bucket algorithm.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bucket4j

kong-scalable-rate-limiter
Kong plugin for Rate Limiting at high throughputs.
Stars: ✭ 19 (-98.15%)
Mutual labels:  rate-limiting, rate-limiter
Redis Ratelimit
A fixed window rate limiter based on Redis
Stars: ✭ 15 (-98.54%)
Mutual labels:  rate-limiter, rate-limiting
Bottleneck
Job scheduler and rate limiter, supports Clustering
Stars: ✭ 1,113 (+8.59%)
Mutual labels:  rate-limiter, rate-limiting
Gubernator
High Performance Rate Limiting MicroService and Library
Stars: ✭ 609 (-40.59%)
Mutual labels:  rate-limiter, rate-limiting
phalcon-throttler
Phalcon Throttler is a Rate Limiter for the PHP Phalcon Framework.
Stars: ✭ 19 (-98.15%)
Mutual labels:  rate-limiting, rate-limiter
zlimiter
A toolkit for rate limite,support memory and redis
Stars: ✭ 17 (-98.34%)
Mutual labels:  rate-limiting, rate-limiter
Guzzle Advanced Throttle
A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get the response from cache when the rate limit is exceeded or always get a cached value to spare your rate limits. Using wildcards in host names is also supported.
Stars: ✭ 120 (-88.29%)
Mutual labels:  rate-limiter, rate-limiting
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (-96.98%)
Mutual labels:  rate-limiting, rate-limiter
Hammer
An Elixir rate-limiter with pluggable backends
Stars: ✭ 366 (-64.29%)
Mutual labels:  rate-limiter, rate-limiting
gentle-force
Brute-force, error and request rate limiting
Stars: ✭ 45 (-95.61%)
Mutual labels:  rate-limiting, rate-limiter
rush
rush.readthedocs.io/en/latest/
Stars: ✭ 42 (-95.9%)
Mutual labels:  rate-limiting, rate-limiter
limitrr-php
Better PHP rate limiting using Redis.
Stars: ✭ 19 (-98.15%)
Mutual labels:  rate-limiting, rate-limiter
Annon.api
Configurable API gateway that acts as a reverse proxy with a plugin system.
Stars: ✭ 306 (-70.15%)
Mutual labels:  rate-limiting
Sentinel
A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
Stars: ✭ 18,071 (+1663.02%)
Mutual labels:  rate-limiting
Rate Limit
Meteor package to rate-limit a function by queuing up calls (instead of dropping them like throttle or debounce)
Stars: ✭ 15 (-98.54%)
Mutual labels:  rate-limiting
Golimit
Golimit is Uber ringpop based distributed and decentralized rate limiter
Stars: ✭ 581 (-43.32%)
Mutual labels:  rate-limiter
Ratelimit
基于令牌桶算法和漏桶算法来实现的限速限流,Golang实现。
Stars: ✭ 271 (-73.56%)
Mutual labels:  rate-limiter
course-spring-microservices
Code examples built for the purpose of video course: Microservices With Spring Boot And Spring Cloud
Stars: ✭ 74 (-92.78%)
Mutual labels:  rate-limiting
Api Boot
“ ApiBoot”是为接口服务而生的,基于“ SpringBoot”完成扩展和自动配置,内部封装了一系列的开箱即用Starters。
Stars: ✭ 460 (-55.12%)
Mutual labels:  rate-limiter
caddy-ratelimit
HTTP rate limiting module for Caddy 2
Stars: ✭ 72 (-92.98%)
Mutual labels:  rate-limiting

Java rate-limiting library based on token-bucket algorithm.

Join the chat at https://gitter.im/vladimir-bukhtoyarov/bucket4j Licence Donate

Advantages of Bucket4j

  • Implemented on top of ideas of well known algorithm, which are by de-facto standard for rate limiting in the IT industry.
  • Effective lock-free implementation, Bucket4j is good scalable for multi-threading case.
  • Absolutely non-compromise precision, Bucket4j does not operate with floats or doubles, all calculation are performed in the integer arithmetic, this feature protects end users from calculation errors involved by rounding.
  • Ability to switch from one JVM to cluster in two lines of code. Using Bucket4j you are able to limiting something in the cluster of JVMs. Since release 1.2 the Bucket4j supports any GRID solution which compatible with JCache API (JSR 107) specification. Just use your favorite grid including Hazelcast, Ignite, Coherence, Infinispan or any other.
  • Ability to specify multiple bandwidths per bucket. For example you can limit 1000 events per hours but not often then 100 events per minute.
  • Both synchronous and asynchronous API.
  • Pluggable listener API that allows to implement monitoring and logging.
  • Ability to use bucket as a scheduler, see examples.

Supported back-ends

As mentioned above in addition to local in-memory buckets, the Bucket4j supports clustered usage scenario on top of following back-ends:

Back-end Documentation page Async supported Optimized serialization
JCache API (JSR 107) bucket4j-jcache No No
Hazelcast bucket4j-hazelcast Yes Yes
Apache Ignite bucket4j-ignite Yes n/a
Inifinispan bucket4j-infinspan Yes Yes
Oracle Coherence bucket4j-coherence Yes Yes

General documentation

Basics:

Examples:

Production checklist

  • Common production checklist - Mandatory points that need to be understood before using the Bucket4j in production, independently of local or clustered usage scenarios.
  • JCache production checklist - Mandatory points that need to be understood before using the Bucket4j over JCache cluster.

Archive:

Third-party integrations:

Third-party demos and articles:

Get Bucket4j library

You can add Bucket4j to your project as maven dependency

The Bucket4j is distributed through Maven Central:

<dependency>
    <groupId>com.github.vladimir-bukhtoyarov</groupId>
    <artifactId>bucket4j-core</artifactId>
    <version>6.0.2</version>
</dependency>

You can build Bucket4j from sources

git clone https://github.com/vladimir-bukhtoyarov/bucket4j.git
cd bucket4j
mvn clean install

Have a question?

Feel free to ask via:

License

Copyright 2015-2020 Vladimir Bukhtoyarov Licensed under the Apache Software License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].