Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.13 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.13 KB

Rate Limiter using Node.js & REDIS

Intro

This Rate Limiter application is a part of the Episode - 1 of SharedX organised on Saturday, March 23, 2019 in Noida

This application is using the Node-API-Template. You can read about the codebase structure there.

How to RUN

  • git clone git@github.com:shredx/node-redis-rate-limiter.git
  • npm install
  • npm run dev

Note: Make sure REDIS is running

Gotchas

  • Don't forget to create a .env file

Concept

  • Create and store users in REDIS
  • Provide Subscription Keys to the users
    • A user cannot have more than 3 keys
  • Each key has usage limit aggisned to it
  • Based on the usage the user is blocked from accessing the routes/features

Components

  • REDIS
  • Node.js API Service which publishes usages to the REDIS pub-sub
  • Golang API Service that manages the usages and broadcast the BLOCK event
  • Node.js API Gateway which blocks the users
    • This service maintains a local cache

Todos

  • Add link to different services
  • Add list of contributors
  • Dcoumentation for the application