Systems Design
System Design¶
Vocab:
- Vertical scaling: adding more power (CPU, RAM, etc.) to your servers. Better for low traffic
- Horizontal scaling: adding more servers into your pool of resources. Better for fail-over and redundancy
Rate Limiting¶
Token bucket algorithm: only allow X number of requests in the queue
Leaking bucket algorithm: first-in-first-out (FIFO) queue. If queue is full then drop request
Fixed window counter algorithm: Only allow X requests per Y period of time
Sliding window log algorithm: Uses a Circular queue and drops requests that are too old and not finished
Sliding window counter algorithm: A combination of Sliding window log algorithm
and Fixed window counter algorithm