News for hackers. Stuff that matters.
Re:Scaling your API with rate limiters by fspear on Thursday March 30, 2017 @07:22PM (#13999816)
Great post however does anyone know how rate limiting specific users is typically implemented? For instance if you have a SaaS API with multiple subscription plans you generally rate limit users based on tier e.g free tier: up to X number of requests, paid tier: unlimited number of requests, etc. I am assuming this is typically handled in the API itself.

Thanks in advance.

Re:Scaling your API with rate limiters by ptarjan on Thursday March 30, 2017 @07:43PM (#13999950)
Thanks! The buckets are already done per-user so it is very simple to make the constant factors be user-dependent.

For my example in https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff... you would just set REPLENISH_RATE to be a different value for different users.

Re:Scaling your API with rate limiters by fspear on Thursday March 30, 2017 @08:23PM (#14000226)
Thanks!