In distributed systems, the biggest challenge for rate limiting is state . How do you ensure that two parallel requests hitting different cluster nodes don’t “double-spend” the same token? In this article, we dive into the implementation details of the integration between the Bucket4j rate-limiting framework and Embedded Infinispan (not HotRod).