aditya109 / aditya109/API-Rate-Limiter

Create golang API rate limiting middleware

オープン
#7 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。