6 ms·
The article mentions they took some inspiration from a Stripe blogpost/gist; for convenience, here's the direct link to the relevant lua code (helps compare wha
by rattray 6y ago
The article mentions they took some inspiration from a Stripe blogpost/gist; for convenience, here's the direct link to the relevant lua code (helps compare what is interesting/unique about github's approach):
https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d#file-request_rate_limiter-lua https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff...
(disclaimer, I worked on the rate limiter at Stripe a bit, but can't remember how similar the 2019-era code was to what you see there; I think broadly similar).
- rattray 6y agoAh, it turns out my former colleagues @brandur, who worked on rate limiting at Stripe for some time after the blog post was written, has a Redis rate-limiting module published here: https://github.com/brandur/redis-cell/ https://github.com/brandur/redis-cell/
- Operyl 6y agoAh, that’s great! I was just looking down this path the other day for a project I need coming up soon. This’ll save a good days worth of work :).
- uyt 6y agoI also found https://cloud.google.com/solutions/rate-limiting-strategies-techniques https://cloud.google.com/solutions/rate-limiting-strategies-... to be useful. In particular at the very bottom they link to a lot of other blogs about rate limiting such as: https://www.figma.com/blog/an-alternative-approach-to-rate-limiting/ https://www.figma.com/blog/an-alternative-approach-to-rate-l... I am only reading about them because for whatever reason this has become a trendy "system design" interview question.
- hrpnk 6y agoIt's a task that's easy and quick to understand for any engineer in terms of requirements. Also, it offers great depth in terms of approaches, technology selection, and data volumes to be analyzed.