Skip to content

Instantly share code, notes, and snippets.

View prodigy4440's full-sized avatar
🎯
Focusing

Isau Opeyemi AZEEZ prodigy4440

🎯
Focusing
View GitHub Profile
@itamarhaber
itamarhaber / some_thoughts.md
Created February 23, 2018 19:18
Some thoughts about "Building a sliding window rate limiter with Redis"

Reading Building a sliding window rate limiter with Redis, and w/o addressing the actual logic (which may or may not work).

Optimize by:

  1. Lua seems a much better choice: idiompotent, portable, server-side, less bandwidth, atomic...
  2. The call to ZRANGEBYSCORE seems to be unused, should be commented out if so
  3. Looking at the use of ZRANGE, it appears that ZCARD it what's actually needed

The (untested) Lua snippet: