Concept Flow - Rate limiting with sliding window
Request arrives
Get current timestamp
Calculate window start time
Remove timestamps older than window start
Count remaining timestamps
If count < limit?
No→Reject request
Yes
Add current timestamp
Allow request
Each request is checked against recent requests in a time window. Old requests are removed, and if the count is below the limit, the request is allowed and timestamp recorded.
