Sunday, September 17, 2023

Rate limiting with Redis cache

Rate Limiting - What is Rate Limiting? | Redis

Building a rate limiter with Redis is easy because of two commands INCR and EXPIRE. The basic concept is that you want to limit requests to a particular service in a given time period. Let’s say we have a service that has users identified by an API key. This service states that it is limited to 20 requests in any given minute.

peterkhayes/rolling-rate-limiter: Rate limiter for node.js that supports a rolling window, either in-memory or backed by redis @GitHub

rolling-rate-limiter - npm

This is an implementation of a rate limiter in node.js that allows for rate limiting with a rolling window. It can use either in-memory storage or Redis as a backend. If Redis is used, multiple rate limiters can share one instance with different namespaces, and multiple processes can share rate limiter state safely.

Understanding and implementing rate limiting in Node.js - LogRocket Blog

Rate limiting with Redis — Ramp Engineering
Python solution

free book: 
Redis for Dummies | Redis
Redis™ For Dummies®, 2nd Limited Edition

No comments: