Rate limiting is intentionally not a single synchronous global counter. The system converges in layers so the request path stays fast even when shared dependencies are slow or unavailable.Documentation Index
Fetch the complete documentation index at: https://engineering.unkey.com/llms.txt
Use this file to discover all available pages before exploring further.
Convergence layers
Each layer handles a different scope.| Layer | Scope | Purpose |
|---|---|---|
| Local memory | One process | Make the immediate decision without a network round trip |
| Regional origin | One region | Converge multiple processes serving the same region |
| Global counters | All regions | Share meaningful regional usage with other regions |
Regional convergence
After a request is accepted, the process buffers a replay event for the regional origin. Replay merges the regional value back into local memory withmax, so processes in the same region converge toward the same count without waiting on every request.
Cold counters and strict-mode counters read the regional origin synchronously before deciding. This makes the first decision for a key and the decisions after a denial use a fresher regional baseline.
Strict mode
Strict mode is regional. When a request is denied, the service records a deadline for the(workspace, namespace, identifier, duration) tuple. Until that deadline passes, later requests for the same tuple refresh from the regional origin before evaluating the limit.
The strict-mode key excludes the sequence. A denial in one fixed window can still affect the weighted previous-window term in the next fixed window, so strict mode survives the sequence rollover.
Strict mode does not publish cross-region state. Global convergence is handled by global counters.
Global convergence
Global convergence is eventual. A region publishes its own regional count when the count becomes meaningful for remote decisions. Other regions import the sum of foreign regional counts and include that imported count in future decisions.Failure behavior
Failures degrade toward local decisions and recover when the affected layer becomes available again.| Failure | Behavior |
|---|---|
| Regional read fails | The process continues from its local count |
| Regional replay lags | Other nodes in the region converge later |
| Global publish lags | Other regions do not see the new count yet |
| Global import lags | The region continues with its existing imported counts |

