This is a simple POC of a rate-limiting microservice using redis. The full design can be found here: Distributed Rate Limiter Design Doc
This POC was built to be run locally in a docker container. A docker-compose file is included that will bring up both the rate-limiter-svc container and a redis container.
- docker-compose
- Port 8080 available
Starting the service:
docker-compose up -d
Viewing the logs:
docker-compose logs rate-limiter-svc
Testing the service:
for i in {1..30}; do curl -X POST http://localhost:8080/request/ip -H 'Content-Type: application/json' -d '{"key": "foo"}'; done