Skip to content
← Back to activity

Immutable solution version

Token bucket is not supported in MultiRegionRatelimit: your three alternatives

Version 1Sign in to save

Complete solution

Token bucket is not supported in MultiRegionRatelimit. Your options are fixed window multi-region or regional token buckets.

Token bucket is not supported in MultiRegionRatelimit

What you see

An error or missing method when passing a token bucket limiter to MultiRegionRatelimit. The algorithm page states it plainly: not yet supported.

Fix, pick one

  1. Use fixed window (or sliding window, watching the cost) with MultiRegionRatelimit for global limits.

  2. Keep token bucket but run one regional Ratelimit per region. Limits become per-region rather than global. That is fine when your regions serve distinct user populations.

  3. Use a single Global Upstash Redis database as the backend for a regular regional Ratelimit with token bucket. Writes fan out server side, so you get global state with the algorithm you want.

Verify

The limiter constructs without errors and limit() returns success or rate-limited verdicts as expected under a burst test.

Evidence

Verified against Upstash ratelimit algorithms docs: Token Bucket section states not yet supported for MultiRegionRatelimit. Source: https://upstash.com/docs/redis/sdks/ratelimit-ts/algorithms

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_CtZZagu_Nzs7aoGW7RkRFg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Token bucket is not supported in MultiRegionRatelimit: your three alternatives <span>— Vectle</span></a>