Programming language: Java
License: Apache License 2.0
Tags: Utility     Projects    
Latest version: v4.10.0

bucket4j alternatives and similar libraries

Based on the "Utility" category.
Alternatively, view bucket4j alternatives based on common mentions on social networks and blogs.

  • Arthas

    Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas
  • Java Diff Utils

    Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.

Do you think we are missing an alternative of bucket4j or a related project?

Add another 'Utility' Library


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 Thin-client support
JCache API (JSR 107) [bucket4j-jcache](doc-pages/jcache-usage.md) No No No
Hazelcast [bucket4j-hazelcast](doc-pages/hazelcast.md) Yes Yes Planned
Apache Ignite [bucket4j-ignite](doc-pages/ignite.md) Yes n/a Yes
Inifinispan [bucket4j-infinspan](doc-pages/infinispan.md) Yes Yes No
Oracle Coherence [bucket4j-coherence](doc-pages/coherence.md) Yes Yes No

General documentation


  • Token bucket wikipedia - wikipedia page describes the token-bucket algorithm in classical form.
  • [Non-formal overview of token-bucket algorithm](doc-pages/token-bucket-brief-overview.md) - the brief overview of token-bucket algorithm.


  • [Basic-usage](doc-pages/basic-usage.md) - examples of basic usage.
  • [Advanced-usage](doc-pages/advanced-usage.md) - examples of advanced usage.
  • [Asynchronous-usage](doc-pages/asynchronous.md) - examples of asynchronous usage.
  • [Listening of bucket events](doc-pages/listener.md) - examples of monitoring.

Production checklist

  • [Common production checklist](doc-pages/production-generic-checklist.md) - Mandatory points that need to be understood before using the Bucket4j in production, independently of local or clustered usage scenarios.
  • [JCache production checklist](doc-pages/production-jcache-checklist.md) - Mandatory points that need to be understood before using the Bucket4j over JCache cluster.


  • [Documentation for legacy releases](doc-pages/archive-links.md).

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:


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:


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

*Note that all licence references and agreements mentioned in the bucket4j README section above are relevant to that project's source code only.