A basic rate limiter implementation to understand how request limiting works in backend systems.
This project limits the number of requests a user can make within a specific time window.
If the user exceeds the allowed limit, further requests are rejected.
- Multiple rate limiting strategies:
- Fixed Window
- Sliding Window
- Token Bucket
- Per-user request tracking
- Thread-safe in-memory storage
- Simple and extensible design
- Each request is associated with a user key (e.g., userId or API key)
- The system tracks requests for that key
- On every request:
- If limit not exceeded → request allowed
- If limit exceeded → request rejected
- Java
- ConcurrentHashMap (in-memory storage)
- Basic concurrency handling
- Uses in-memory storage (data lost on restart)
- Not suitable for distributed systems
- No persistence layer
- Basic implementation for learning purposes
git clone https://github.com/your-username/rate-limiter.git
cd rate-limiter
mvn clean install
mvn spring-boot:run