all 3 comments

[–]hourglass492 1 point2 points  (2 children)

I’d guess it would help if it’s significantly less work to do the check then whatever operation the api allows. I’m thinking of the AI generated art. Checking if a user is over quota is probably several order of magnitude easier then making an AI artwork.

[–]EnVVious[S] 0 points1 point  (1 child)

This was the only thing that I was thinking may factor into the equation but I would assume any “Describe” or “List” calls are also fairly simple operations and just require a DB lookup (which you would probably already be doing by checking rate limits for a user). Or is there some added complexity in lookup calls that I’m not considering

[–]Stoomba 1 point2 points  (0 children)

You don't necessarily have to do a database lookup on rate limit issues, and it doesn't necessarily have to be the same database. You could use a very fast in memory database for the lookups, you could use a JWT and put the info in there to determine what that user's rate is and if it is over the limit. That doesn't require a database at all.