2 points · by speckx · 9mo ago · 1 comment
In a recent project, I experimented with keeping the rate limiter entirely in-memory using ConcurrentHashMap.compute() to implement an atomic sliding window. It worked surprisingly well for smaller services where adding Redis felt like overkill.
I wrote up the approach and some of the tradeoffs here if anyone’s curious: https://github.com/ashutosh-stark/velocity-gate