Skip to content

14.17 Classic System Design Problems Applied ​

This chapter demonstrates how the foundational architectural building blocks of OmniPost (priority queues, idempotency, rate limiters, fallback routing) can be adapted to solve classic system design interview problems.


1. Design a Notification System at 100x Scale ​

  • Requirements: Deliver 1 billion notifications daily across 50 countries.
  • Design: Deploy edge API gateways in 3 global regions (US, EU, APAC); buffer ingestion into regional Kafka clusters; use local worker fleets with Redis token bucket rate limiters; enforce local quiet hours via zoneinfo.

2. Design a Distributed Rate Limiter ​

  • Requirements: Limit user API requests to 1,000 per hour across a distributed cluster.
  • OmniPost Building Block: Reuse the token bucket algorithm from queues/dispatcher.py, replacing the in-process dictionary with a Redis cluster executing atomic Lua scripts.

3. Design a High-Throughput Job Scheduler ​

  • Requirements: Schedule millions of delayed tasks with sub-second execution accuracy.
  • OmniPost Building Block: Adapt ScheduledQueueManager from queues/dispatcher.py, backing future timestamps with Redis Sorted Sets where score is the epoch execution time.

4. Say It Out Loud ​

"The architectural patterns we built in OmniPost directly transfer to classic system design challenges. For example, to design a distributed rate limiter, we can take our token bucket implementation from queues/dispatcher.py and run it against Redis with Lua scripts to achieve atomic, cross-node token consumption with sub-millisecond latency."