Back to projects

Case Study

Distributed Rate Limiter

Redis-based traffic control system designed to keep APIs fast while preventing abuse at scale.

Architecture

Client requests are routed to a rate-limiter service that evaluates policy state before forwarding decisions.

Redis stores counters and windows atomically through Lua, removing race conditions during concurrent traffic.

Policy configuration is route-aware so throttling can differ between public and internal APIs.

Screenshots

Screenshot placeholder
Architecture
Service flow and Redis-backed policy evaluation.

Challenges

  • Preserving low latency while keeping decisions atomic across distributed traffic.
  • Designing a data model that supports multiple limiting strategies without duplicating logic.
  • Balancing configurability with straightforward operational behavior.

Benchmarks

10,000+ requests/sec
Sub-5ms latency
Horizontal scalability

Lessons Learned

  • Atomic primitives matter more than complex coordination when latency budgets are tight.
  • A small, explicit policy surface is easier to reason about under load.

Tech Stack

PythonRedisLuaDocker

Key Results

10,000+ requests/sec
Sub-5ms latency
Horizontal scalability