Sliding Window Log rate limiting algorithm is… #flashcard
Idea: Log every request timestamp and keep only those within the window (e.g., last 60 seconds). Enforce limit based on actual log.
- Pros:
- Most accurate rate limiting.
- Can handle arbitrary precision.
- Cons:
- Memory-intensive.
- Slower at high traffic.
Use case: Premium API services where precise rate control is critical per user/token.
<!--ID: 1753886610140-->