Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
Build rate limiter engine
·
Module 7
Distributed Rate Limiting with Redis and Lua
1
Redis Key Structures for Rate Limiting
Design a Redis key structure for the sliding window and token bucket algorithms.
2
Atomic Sliding Window in Redis with Lua
Implement the sliding window logic using a Lua script for atomic updates in Redis.
3
Token Bucket Implementation with Lazy Refills in Lua
Implement the token bucket logic, including lazy refills, using a Lua script.
Auto-Expiring Rate Limit Keys with Redis TTL
Use Redis TTL/EXPIRE to automatically manage the memory of inactive rate limit keys.
5
Redis Rate Limiter Integration
Integrate the Redis-based implementations behind the common `RateLimiter` interface.
6
Testing Redis Implementations
Write unit tests verifying the behavior of the Redis-based implementations.
Previous module
Distributed State Management with Redis
Next module
Dynamic Configuration with YAML