aditya109 / aditya109/API-Rate-Limiter

Create golang API rate limiting middleware

Ouverte
#7 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Python
Étoiles
0
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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).

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.