Tejas' Blog - Implementing account-specific rate limits in Rails
04-Jun-2026 6
We can easily configure global rate limits, but how can we make them dynamic?
In a previous post I explored how to add account-specific IP whitelisting in a Rails/rack app. This post explores similar problem space, this time adding per-account rate limiting.
We generally add global rate limits via nginx or CDN - a limit of X requests per minute/hour for a particular IP. But some customer accounts in my application needed extra limits for API usage and were willing to pay more for it 💰, however the default limit should stay for remaining customers. This meant the global CDN rate limit would not work.
Tejas' Blog - Implementing account-specific rate limits in Rails #ruby #rubydeveloper #rubyonrails #Tejas' #Implementing #account-specific #limits #Rails #blog https://rubyonrails.ba/link/tejas-blog-implementing-account-specific-rate-limits-in-rails