Back to all questions

What is throttling?

API DesignSystem designMiddleSenior
Seen on interview:3 users

Throttling is a programming technique that limits how often something can run. Put simply, we specify that the code can’t be executed more often than once every N milliseconds. The best way to understand throttling is to look at an example.

Throttling in APIs

For example, you’re building a system that works with many tenants (customers), who can choose pricing plans based on their needs for your API.

A typical problem in such systems is noisy tenants. Imagine a customer chose the highest-tier plan, but the rate of requests they make is so high that they end up consuming a significant portion of the resources. As a result, other customers experience response latency issues or slow data loading.

In this case, by using throttling you can specify that the maximum request rate is 1,000 per second. This can potentially reduce the load on your resources and allow all customers to use the system properly.

Seen on interview?

Comments (0)

Sign in to leave a comment

No comments yet. Be the first!