Closed devondragon closed 1 year ago
Having done some research, I think the best course here is to recommend the use of Bucket4J and the Bucket4J Spring Boot Starter.
There's a decent guide here: https://www.baeldung.com/spring-bucket4j
Essentially, using the Bucket4J Spring Boot Starter, you can use yaml configuration to setup complex rate limiting rules for specific URI resources, keying off of things like IP address, username (if authenticated), API-Keys in request headers, and much more, using SPEL syntax. Bucket4J also integrates with various caches and cluster aware solutions. This seems like the perfect solution for this need.
I would like to have an easy to configure rate limiting solution, which allows for resource specific IP based rate limiting. For this framework it will probably just use an in-memory counter, but should be easily extensible for cluster-level management (via Redis, etc...).