Rate Limiter

System Design Interview - Chapter 8 - Design a URL Shortener

System Design Interview - Chapter 8 - Design a URL Shortener

Translations: RU

The previous chapters have described the underlying technologies such as consistent hashing, ID generator, and now using these techniques we can develop a URL shortener that can generate 100 million URLs per day.

Design consists of the following elements:

  • API endpoints
  • URL redirecting
  • URL shortening
  • Data model
  • Hash functions: Hash + collision resolution vs Base-62 conversion
  • Additional topics to consider:
    • Rate limiter
    • Web server scaling
    • Database scaling
    • Analytics
    • Availability, consistency, and reliability

These items are disclosed in a very interesting Chapter 8 of the book:

System Design Interview - Chapter 4 - Design a Rate Limiter

System Design Interview - Chapter 4 - Design a Rate Limiter

Translations: RU

Every popular software should have a Rate Limiter. It prevents DDOS attack, reduces cost and prevents servers from being overloaded.

There are some tricky questions to be considered during implementation of Rate Limiter:

  • Where to put Rate Limiter: client-side, server-side, gateway?
  • Algorithms for rate limiting. There are many algorithms with pros and cons: Token bucket, Leaking bucket, Fixed window counter, Sliding window log, Sliding window counter. Your business needs will define the right algorithm.
  • How are rate limiting rules created?
  • Where are the rules stored?
  • How to handle requests that are rate limited?

These questions are disclosed in a very interesting Chapter 4 of the book: