Skip to content

The Node.js microservice to create users, create subscription keys & publish API usage

Notifications You must be signed in to change notification settings

shredx/node-redis-rate-limiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

The Node.js microservice to create users, create subscription keys & publish API usage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published