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 4
Advanced In-Memory Implementations
1
Thread-Safe Sliding Window Counter with AtomicLong
Implement the in-memory sliding window counter using AtomicLong for thread-safe updates.
2
Implementing a Token Bucket Algorithm
Design a TokenBucket class with capacity, available tokens, and last refill timestamp.
3
Building a Token Bucket with Locks
Implement a lock-based token bucket using synchronized blocks or ReentrantLock.
4
Lock-Free Token Bucket with AtomicLong and CAS
Refactor the token bucket to a lock-free implementation using AtomicLong with CAS loops.
5
Lock-Based vs. Lock-Free Concurrency: Performance Trade-offs
Explain the performance trade-offs between lock-based and lock-free concurrency models.
6
Implementing the RateLimiter Interface
Ensure all in-memory algorithms conform to the `RateLimiter` interface.
Previous module
Initial Implementation and Integration
Next module
Multi-Tenant Key Resolution Strategies