distributed-rate-limiter
Problem
APIs need protection from abuse and overload, but traditional rate limiters using in-memory state don't scale across instances, while synchronous database logging adds unacceptable latency under high throughput.
Solution
A dual-path architecture: synchronous Redis Lua token buckets for sub-5ms rate decisions (fail-open on Redis outage), with asynchronous Kafka event streaming for audit persistence — achieving separation of concerns via independent Rate Limiter and Audit Consumer services.