రేట్ లిమిటింగ్ ఒక క్లায়েంట్ సమయ విండోలో ఎన్ని అభ్యర్థనలు చేయగలదో నిర్బంధిస్తుంది — సిస్టమ్లను దుర్వినియోగం నుండి రక్షించటం, ఓవర్లోడ్ను నిరోధించటం, మరియు న్యాయమైన వినియోగం నిশ్చితం చేయటం. ఇది అనేక అల్గారిథమ్లు మరియు పరిగణనలతో సాధారణ సిస్టమ్-డిజైన్ భాగం.
రేట్ లిమిటింగ్ ఎందుకు
✓ PROTECT against abuse → prevent attacks (brute force, scraping, DoS), excessive use
✓ PREVENT OVERLOAD → protect the system from being overwhelmed (stability)
✓ FAIR USAGE → ensure no single client monopolizes resources; tiered limits (free vs paid)
✓ COST control; protect downstream services
→ a common requirement for APIs and services.
రేట్ లిమిటింగ్ అల్గారిథమ్లు
FIXED WINDOW → count requests per fixed time window (e.g. 100/minute); simple
✗ allows bursts at window boundaries (up to 2x at the edges)
SLIDING WINDOW → rolling time window → smoother, no boundary bursts (more accurate)
TOKEN BUCKET → tokens refill at a rate; each request takes a token → allows BURSTS up to
the bucket size while limiting the average rate (popular, flexible)
LEAKY BUCKET → requests processed at a steady rate (smooths output)
