Throttling
Throttling is another pattern we may need to use in today's applications, services, and APIs. In this context, throttling is based on limiting the number of requests a user can send to a given web service in a given amount of time, in order to protect the resources of the service from being overused by some users.
For example, we may want to limit the number of user requests for an API to 1000/day. Once that limit is reached, the next request is handled by sending an error message with the 429 HTTP status code to the user with a message such as too many requests.
There are many things to understand about Throttling, including which limiting strategy and algorithm one may use and measuring how the service is used.
You can find technical ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access