Real-Dev-Squad / website-backend

The backend code for all our website-related apps
https://api.realdevsquad.com/
MIT License
47 stars 201 forks source link

Deliverables, ETAs, Milestones - Rate Limting Middleware | Parent Ticket | #1073

Open bajajcodes opened 1 year ago

bajajcodes commented 1 year ago

Problem

Solution

Info:

Deliverables

Feature Name Feature ETA Feature Status Feature Description Feature PR/ Discussion Prod Ready
Rate Limiting Rules: Research, Analysis, and Identifying Acceptable Rates 14/05/2023 IN_PROGRESS This feature involves researching, identifying, and coming up with rate-limiting rules for common rate limiters and a few routes for testing and debugging while developing. Already build solutions references will be taken for identifying how they came up with the solution. Proposed: Using newrelic to come up with rate limit parameters and their values N
Route-Based Rate Limiting: Common Rate Limiter Middleware 18/05/2023 IN_PROGRESS This feature involves: setting up the node-rate-limiter-flexible package, using in-process memory store(temp), getting rate limiting rules from variables stored in process memory (temp). PR: Setting Up Rate Limitier N
Route-Based Rate Limiting: Route Specific Rate Limiter Middleware 24/05/2023 IDLE This involves implementing the solution for multiple route-based rate limiters, switching between rate limiters based on the request and again using in-process memory store and environment variables temporarily. -- N
Redis: Database for Storing Rate Limiting Rules 30/05/2023 IDLE Setting up Redis hash database for storing rate limiting rules, config helper functions/classes for creating rules following the template. -- N
Redis: Notifying Backend and Rate Limiter Middleware Of Changes 03/06/2023 IDLE Setting up Redis pub/sub for notifying backend and rate-limiter middleware on create/update/delete of rate limiting rules and redeploying the route-based rate-limiters. -- N
Redis: Cache Service for Storing Rate Limiter Middleware Store(s) 11/06/2023 IDLE Setting up Redis cache service as a memory store for rate limiters stores(route-based rate limiting) for maintaining consistency across different instances if in case auto-horizontal-scaled by deployment-service(railway.app) provider. -- N
Client Unique Identifier and Builder: IP Address Resolution 16/06/2023 IDLE Helper functions/class to identify and resolve client-unique IP addresses behind a public IP. -- N
Client Unique Identifier and Builder: IP Address Resolution 22/06/2023 IDLE Helper functions/class to identify and resolve client-unique IP addresses behind proxy IP. Using headers x-forwarded-for, port, and subnetting. -- N
Client Unique Identifier and Builder: UserId Resolution 26/06/2023 IDLE Helper functions/class to identify and resolve client-unique userId. -- N
Client Unique Identifier and Builder: Miscellaneous 30/06/2023 IDLE Helper function/class to identify and resolve client-unique-identifier(cuid or client-uid) based on a parameter named type (ipaddress, userId, both) passed. -- Y
Role-Based Rate Limiting: Identifying Acceptable Rate 05/07/2023 IDLE Defining and Identifying, different rate-limiting rules for users with different roles, such as app_owner, super_user, member, and user. -- N
Role-Based Rate Limiting: Implementation 08/07/2023 IDLE Implementing Different rate-limiting rules for users with different roles, such as app_owner, super_user, member, and user. -- Y
Dashboard Site: Design For Configuring Rate Limiting Rules To Be Calculated IDLE To Be Added -- N
Dashboard Site: Design/UI Implementation To Be Calculated IDLE To Be Added -- N
Dashboard Site: CRUD operations Implementation and Integrating Redis Service, Backend and Rate Limiting Middleware To Be Calculated IDLE To Be Added -- Y

[Note:]

[Info]:

References

vikhyat187 commented 1 year ago

Hey @shmbajaj can we add further breakdown of tasks which are likely to consume more days, like there is a task which estimate is 11days. Also we can divide the tasks and get them built parallel.

bajajcodes commented 1 year ago

Hey @shmbajaj can we add further breakdown of tasks which are likely to consume more days, like there is a task which estimate is 11days. Also we can divide the tasks and get them built parallel.

Hey, @vikhyat187 I have a breakdown of the tasks dashboard feature. FYI:

prakashchoudhary07 commented 1 year ago

Nice breakdown of tasks super cool, well documented 🚀

bajajcodes commented 1 year ago

Rate Limiting Rules: Research, Analysis, and Identifying Acceptable Rates

This feature involves researching, identifying, and coming up with rate-limiting rules for common rate limiters and a few routes for testing and debugging while developing. Already build solutions references will be taken for identifying how they came up with the solution.

Problem Breakdown

Researching, identifying, and coming up with rate-limiting rules for common rate limiters and a few routes for testing and debugging while developing.

To come up with rate-limiting parameters(Rate (Requests / Period), Counting characteristics, Duration) values for global rate limit and per-API rate limit, newrelic APM(Application Performance Monitoring) can be used.

Here's how newrelic APM can help:

INFO:

By leveraging New Relic APM and following these steps, can practically analyze traffic data, and determine API rate limiting parameters at different levels.

Referencing already build solutions for identifying how they came up with the solution and rate limiting parameters and values.

References

vikhyat187 commented 1 year ago

LGTM