System Design Interview: Chapter 04

Disclaimer

The contents here are derived while reading the book "System Design Interview: An Insider’s Guide" . Only the important concepts that may be needed in future for reference will be mentioned here. Please go to the official book at System Design Interview Book for more detail.

Chapter - 04: Designing a Rate Limiter

Limit the number of requests from client.

All requests in excess than the defined threshold are blocked.

Main Benefit is to prevent Denial of Service Attack. Another benefit is to reduce cost. Also, to not impact performance of server by overloading them with excess requests from some unruly accounts/users.

Implementation

Server side rate limiting because we dont have control over client side implementation.

In real world, most servers already have API gateway. API gateway provides rate limiting capacity. Or, in designing an API gateway, you can add rate limiting in its design.

Algorithms for Rate Limiting