Decentralized Rate Limiter

13 Jun

Authors: Souvik Sarkar

Abstract: As distributed systems operate at increasingly high throughput, enforcing fair and efficient request control becomes critical to safeguard service reliability and prevent misuse. This work introduces a decentralized rate limiting mechanism engineered for scalability and resilience without central oversight. The solution integrates Conflict-free Replicated Data Types (CRDTs) for consistent state sharing and employs the libp2p gossip protocol to synchronize nodes through peer-to-peer communication. Each peer manages an LRU-based in-memory cache for frequent users and offloads less active records to disk, balancing performance with persistence. Performance evaluations indicate that each node can independently process up to 3,000 requests per second, maintaining a 99th percentile latency below 2 milliseconds. CRDT-based synchronization across peers shows convergence latencies around 2 ms with compact gossip payloads averaging 3 KB. These findings validate the feasibility of a decentralized architecture for rate limiting, offering a robust alternative to traditional centralized techniques in modern cloud-native systems.