Module 10 · System Design · Six more low-level rounds
Design a rate limiter (the class inside the bouncer)
Design a Rate Limiter · Open board
The bucket and its refill line, the arithmetic from empty, the swappable rules with a fake clock, and twenty servers sharing one limit.
Before you start. You need three earlier ideas. The bouncer at the door (rate limiting) showed the system-design view: a bouncer who counts requests per face and protects the slow thing behind him, and the saucer of coins called a token bucket. This lesson builds the bouncer’s notebook as classes. Swap the rule, keep the class (Strategy and Factory) gave you the strategy, one job with several interchangeable rules behind one method call. Two people, one seat (thread-safe booking) gave you the race condition and the lock. You need to read a little Python.
Lesson 47 of 73 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.