/rate-limiting-algorithm

Rate Limiting is hybrid version of Fixed Window Algorithm, works on public routes with IP Address and private routes with JWT, also has configurable limit-weight for every route. Can be configured from .env MongoDB-Redis cache for reducing time for authenticate user.

Primary LanguageJavaScriptMIT LicenseMIT

Rate Limiting Middleware

Rate Limiting is hybrid version of Fixed Window Algorithm, works on public routes with IP Address and private routes with JWT, also has configurable limit-weight for every route. Can be configured from .env
MongoDB-Redis cache for reducing time for authenticate user.

Features

Custom Limit and Weights for different routes
Limit and Weights can be used by both ip addresses and bucket tokens
MongoDB-Redis Caching for better query performance
Cluster Mode for concurrent http requests

Authenticate User Flowchart ( With Cache )

Flowchart
Note: Caching will not work if user authentication is fails so wrong authentication will be result in slower http response time.