- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Twitter uses Token Bucket — OTP systems use Sliding Window. Here's why. #techshorts
Twitter gets millions of requests during a viral tweet.
OTP systems get spammed by bots every second.
Same problem — unlimited requests.
But they use completely different algorithms. Why?
━━━━━━━━━━━━━━━━━━━━━━━━
🪣 TOKEN BUCKET (Twitter's approach)
━━━━━━━━━━━━━━━━━━━━━━━━
→ Every user gets a bucket of tokens
→ Each request consumes one token
→ Tokens refill at a fixed rate
→ Bucket full? Burst of requests allowed
→ Bucket empty? 429 — Too Many Requests
Why Twitter? Because viral tweets create
sudden traffic bursts. Token Bucket handles
that gracefully without blocking real users.
━━━━━━━━━━━━━━━━━━━━━━━━
🪟 SLIDING WINDOW (OTP's approach)
━━━━━━━━━━━━━━━━━━━━━━━━
→ Count every request in last N seconds
→ Window slides continuously in real time
→ Limit crossed? Hard block. No exceptions.
→ No burst allowed. Ever.
Why OTP? Because 1 extra OTP request
could mean an attacker. Zero tolerance
is the only policy that makes sense.
━━━━━━━━━━━━━━━━━━━━━━━━
⚡ THE DECISION TREE
━━━━━━━━━━━━━━━━━━━━━━━━
Need to handle burst traffic?
→ Token Bucket
Need strict hard limits?
→ Sliding Window
Both implemented in Redis.
Token Bucket → counter + timestamp
Sliding Window → sorted set
━━━━━━━━━━━━━━━━━━━━━━━━
📌 KEY TAKEAWAY
━━━━━━━━━━━━━━━━━━━━━━━━
Rate Limiting is not just an if-else check.
It is an architectural decision.
Pick the wrong algorithm →
legitimate users get blocked
or attackers get through.
Pick the right one →
your system stays alive under pressure.
━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Subscribe for System Design & Backend
concepts explained in 60 seconds.
Every video = one concept = production ready knowledge.
━━━━━━━━━━━━━━━━━━━━━━━━
#SystemDesign #RateLimiting #TokenBucket #SlidingWindow
#BackendDevelopment #SoftwareEngineering #Redis
#APIDesign #LowLevelDesign #TechShorts #Programming
#DistributedSystems #100DaysOfCode #CodeNewbie
#SoftwareDeveloper #SystemDesignInterview
Видео Twitter uses Token Bucket — OTP systems use Sliding Window. Here's why. #techshorts канала InfraWithDipankar
OTP systems get spammed by bots every second.
Same problem — unlimited requests.
But they use completely different algorithms. Why?
━━━━━━━━━━━━━━━━━━━━━━━━
🪣 TOKEN BUCKET (Twitter's approach)
━━━━━━━━━━━━━━━━━━━━━━━━
→ Every user gets a bucket of tokens
→ Each request consumes one token
→ Tokens refill at a fixed rate
→ Bucket full? Burst of requests allowed
→ Bucket empty? 429 — Too Many Requests
Why Twitter? Because viral tweets create
sudden traffic bursts. Token Bucket handles
that gracefully without blocking real users.
━━━━━━━━━━━━━━━━━━━━━━━━
🪟 SLIDING WINDOW (OTP's approach)
━━━━━━━━━━━━━━━━━━━━━━━━
→ Count every request in last N seconds
→ Window slides continuously in real time
→ Limit crossed? Hard block. No exceptions.
→ No burst allowed. Ever.
Why OTP? Because 1 extra OTP request
could mean an attacker. Zero tolerance
is the only policy that makes sense.
━━━━━━━━━━━━━━━━━━━━━━━━
⚡ THE DECISION TREE
━━━━━━━━━━━━━━━━━━━━━━━━
Need to handle burst traffic?
→ Token Bucket
Need strict hard limits?
→ Sliding Window
Both implemented in Redis.
Token Bucket → counter + timestamp
Sliding Window → sorted set
━━━━━━━━━━━━━━━━━━━━━━━━
📌 KEY TAKEAWAY
━━━━━━━━━━━━━━━━━━━━━━━━
Rate Limiting is not just an if-else check.
It is an architectural decision.
Pick the wrong algorithm →
legitimate users get blocked
or attackers get through.
Pick the right one →
your system stays alive under pressure.
━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Subscribe for System Design & Backend
concepts explained in 60 seconds.
Every video = one concept = production ready knowledge.
━━━━━━━━━━━━━━━━━━━━━━━━
#SystemDesign #RateLimiting #TokenBucket #SlidingWindow
#BackendDevelopment #SoftwareEngineering #Redis
#APIDesign #LowLevelDesign #TechShorts #Programming
#DistributedSystems #100DaysOfCode #CodeNewbie
#SoftwareDeveloper #SystemDesignInterview
Видео Twitter uses Token Bucket — OTP systems use Sliding Window. Here's why. #techshorts канала InfraWithDipankar
Комментарии отсутствуют
Информация о видео
30 марта 2026 г. 21:36:43
00:00:59
Другие видео канала




















