connect icon indicating copy to clipboard operation
connect copied to clipboard

using a cache for Rate Limiting

Open kostas-theo opened this issue 6 years ago • 3 comments

@Jeffail,

We have created our own custom processor which can use a redis cluster for rate limiting purposes and would like to contribute the code as new functionality in benthos. Before getting started though I am wondering where and how it should be added in terms of structure. I see a number of different approaches:

  • Create a new cache or redis rate limits resource effectively duplicating the existing cache resource and define new args for this functionality under the existing rate_limit processor
  • Allow the rate_limit processor to use cache resources and define new args for this functionality
  • Create a new rate_limit_cache or rate_limit_redis processor and disregard the rate_limits and cache resource types

Any preferences between these or other ways of structuring this new functionality??

kostas-theo avatar Dec 09 '19 11:12 kostas-theo

Hey @kostas-theo, sounds like a great addition, I'd love a distributed rate limit option.

Ideally this would be implemented as a rate_limit resource component even if it involves a small amount of duplication. That would allow it to be used by the rate_limit processor as well as any HTTP components, etc.

Don't hesitate to ask for guidance or anything, I'm happy to review draft PRs if it helps.

Jeffail avatar Dec 09 '19 21:12 Jeffail

@kostas-theo did you had any progress in this?

lucasoares avatar Oct 27 '22 21:10 lucasoares

Just submitted a PR for this but I have a few questions there. @Jeffail

lucasoares avatar Nov 09 '22 23:11 lucasoares