Redis rate limiter

25-Feb-2021 1305
At Rebased we have an internal time tracking project called Harmonogram. Its backend is built in Ruby on Rails. It started as a playground for new hires to get used to company culture and conventions, but over time grew into a fully-functional tool. When I joined, the application was already being used internally and we were hitting interesting performance problems. One of them was reaching the rate limit of Toggl API calls. And since this was my first week at the company, I was tasked with solving this issue.The problemThe Toggl documentation recommended sending requests at most every second in order to avoid hitting the limit – which we were already doing in a naive way, so the solution wouldn’t be as easy as adding sleep 1 to every request.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle