Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Throttling API Requests

via CodeSignal

Overview

Throttling manages high request volumes by slowing down requests instead of blocking them. Unlike rate limiting, which rejects excess requests, throttling adds delays when thresholds are exceeded. This keeps your API responsive and stable during traffic spikes.

Syllabus

  • Unit 1: Throttling Middleware in Python
    • Add Logging to Your Python Delay Throttle Decorator
    • Add Maximum Wait Time to Delay Throttle Decorator
    • Add Throttle Feedback Headers to delay_throttle Decorator
  • Unit 2: Token Bucket Throttling
    • Python Token Bucket: Exponential Backoff Retry Mechanism
    • TokenBucket Initialization and Shutdown
    • FastAPI Token Bucket Throttling Middleware
  • Unit 3: Queue Based Throttling
    • Implement a FIFO Request Queue for Throttling in Flask
    • Request Queue Throttling with Timeout Handling in Python
    • Implement Queue-Based Request Throttling Logic
    • Queue-Based Request Throttling Decorator
    • Queue-Based Throttling Load Test Script
  • Unit 4: Tiered Token Bucket Throttling
    • Add Rate Limit Headers to Tiered Token Bucket Middleware
    • Tiered Token Bucket Rate Limiter for Flask Endpoints

Reviews

Start your review of Throttling API Requests

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.