so the rate limiter is something that limits the amount of requests that you can make to a machine that is accepting requests . it can be a http server or any server or backend where you want to like send a request for something it could be an http get request for retrieving something a post request any kind of request.
why do this ?
the reason that we do this is actually a lot simple - to limit the load on the server or the machine that is handeling the requests, well here is what i mean by load to be precise -
- Dos attack load meaning that you asked for more than the server can handle and so your request is behind hundreds of attack requests that are nothing but spam requests to the server .
- the cost of processing these requests , at the end the server itself is a machine right and so that would mean that it needs electricity and resources just to process those 100s of requests right by these attacks the cost of the servers rise and money is always a thing that drives people to optimise . 3.failures this is when the server is in more risk of failures and i dont mean normal failures i mean severe hardware failures that can and does happen if this particular problem is not solved.
so one of the methods to prevent these failures is the conept of rate limiting -
the problem and the solution - the main issue is that the requests are comming from like many many sources right and the people can make as many requests as they can right ? but what if we slow down the flow of the requests comming in ? that is the main idea behind these rate limmiting algorithims .
how to slow down the requests ? well here are a few ideas -
• Token bucket
• Leaking bucket
• Fixed window counter
• Sliding window log
• Sliding window counter
wait for part II
Top comments (0)