Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of API throttling #549

Open
josephdenne opened this issue Apr 24, 2019 · 2 comments
Open

Addition of API throttling #549

josephdenne opened this issue Apr 24, 2019 · 2 comments

Comments

@josephdenne
Copy link
Member

The ability to throttle all methods on the basis of requests over time. This should be globally enforceable, as well as configurable on a per client and per collection basis.

For example, 10 GET requests every second.

@eduardoboucas
Copy link
Contributor

Some notes on this while the thought is fresh:

  • Global configuration: this should be relatively simple. We need to add a new configuration property and read from it on every request.

  • Per-collection configuration: this could be part of the settings block of the collection schema, overriding the global value. Not sure where this stands when we move collection schemas to the database, it probably still works.

  • Per-client configuration: this one is a bit more tricky. We could store rate limits against the client record, but that would mean reading from it on every request, which we currently avoid doing for performance reasons. We could explore the possibility of encoding rate limits on the JWT token payload, meaning that we wouldn't have to hit the database to know the rate limits for a particular client before processing a request. The only downside of this is that it wouldn't be possible to update the rate limits for a given client during the lifecycle of a token – i.e. the new settings would only take place once the client requested a new bearer token. This might be fine if documented, as people can configure the token TTL to this effect.

@josephdenne
Copy link
Member Author

Global rate limiting is really for us, whereas collection and client rate limiting is for customers. So the former is more important than the latter in the near term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants