Repository navigation
v1.0.0: all 24 chapters
The first complete release: all 24 chapters, each one a small simulation you run with python demo.py.
What's inside
- 24 chapters, from rate limiters and LRU caches to Raft consensus, stream windowing and distributed tracing. Each is about 150 lines of plain Python, standard library only, with nothing to install.
- 264 tests across the chapters, run in CI on Linux and Windows with Python 3.11 to 3.13, and on macOS daily.
- 48 challenges, two per chapter, with tests that fail until you build them.
- 192 interview questions (8 per chapter) and 10 full mock interviews that cite the chapter demos.
- A terminal quiz with 96 questions:
python quiz.py. - A one-page cheat sheet covering every chapter.
Every number in the docs is checked in CI against a real run of the demo.
A few things the demos show
- Adding a 5th server moves 80% of keys with
hash % Nand 17% with a hash ring (chapter 03). - Lost replies charge 181 customers twice without idempotency keys, and none with them (chapter 13).
- Async replication failover lost 3 writes that users had already been told were saved (chapter 19).
- Halving a service off the critical path makes the request 0 ms faster; on the critical path, 29 ms (chapter 24).
Get started
git clone https://github.com/mannietech15/system-design-mastery
cd system-design-mastery/03-consistent-hashing
python demo.pyOr open it in GitHub Codespaces from the button in the README.
Contributors
Thanks to @Codre01 for contributing.