I'm planning to use typesense cloud for an application I am developing. I noticed that typesense offers built-in rate limiting which is tied to an API key.
I want to rate limit individual users so one user cannot make many requests and scrape our data, but I do not want to limit all users as a whole.
To avoid needing a separate service to handle rate limiting, I was considering the possibility of assigning each users their own api key which does not expire. This way, I can take advantage of the built in rate limiting without letting a single malicious user rate limit other normal users.
My question is: Is typescript designed/capable of supporting so many api keys? If my app ends up scaling to millions of users, will typescript be able to efficiently match api keys against a list of millions without getting bogged down? Will it also be able to keep track of all of these keys usages for rate limiting without getting bogged down?
I wanted to make sure since the key matching mechanism may not have been designed for such a use case.
If you could let me know if this a good idea to implement per-user rate limiting and let me know of any other design concerns I should consider, that would be great!
Thanks!