Gaurav Sen discusses rate limiting in a distributed system, where he assumes the rate limiter service is distributed to avoid a single point of failure.
We suggest using a database to store the configurations of all services that want to limit rates. We recommend using a rate limiting client to keep a snapshot of the configuration of each service, rather than querying the rate limiter every time a request is made.
A rate-limiting client decides whether to accept or reject a request based on the information it has cached.
A single source of truth is used to propagate the data and make decisions based on the acceptance or rejection of requests. We also talk about the need for endpoints to log failed requests and for a limit on where they should be placed.