aditya109 / aditya109/API-Rate-Limiter
Create golang API rate limiting middleware
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
The rate limiter will be a router, having the following features:
- According to the requirements mentioned in [README.md](https://github.com/aditya109/API-Rate-Limiter/blob/main/README.md), the rate-limiter is going to be a server.
- The rate-limiting-server needs to be scalable, but all of gateway instances needs to use a common database.
- For scalability we can build an image and run it as Deployment on the same cluster.
- The rate-limiter needs to:
- identify the host from the incoming process request,
- create a host-machine identifier,
- attach a rate timeout to it, and it within the shared database.
- When an request is made, the rate-limiter should be the first entity to receive that request.
- Upon receiving the request, checks can be implemented for validating the request.
- Extracted host-machine identifier needs to be validated against the database entries.
- If request is under the agreed upon contract, the request is made by the rate-limiting-server to the K8s service.
- If request is not under the agreed upon contract, the request is rejected by the rate-limiting-server.
> For cleaning up of attached database, we can write a job which can run as a `crob-job` at set times.
- For validation/throttling of APIs we will be implementing [token bucket algorithm](https://en.wikipedia.org/wiki/Token_bucket) (which shall prohibit the request overflow) and followed by [leaky bucket algorithm](https://en.wikipedia.org/wiki/Leaky_bucket) (which shall ensure constant data rate getting injecting onto the network).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.