Skip to content

Latest commit

 

History

226 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System Design Patterns

A framework-agnostic system design fieldbook built around production contracts, protocol mechanics, failure recovery, capacity models, and evidence from papers and operating systems.

Animated tour of the System Design Patterns fieldbook, including its domain map, CAP theorem, LSM tree internals, payment architecture, and RAG evidence flow.

Read the interactive fieldbook · Download PDF or EPUB

"Most system design resources are unorganized and overly simple. This repository aims to change that."

Philosophy

  1. Contracts before components - Start with invariants and observable promises
  2. Depth over breadth - Follow mechanisms through overload, failure, recovery, and migration
  3. Single-owner chapters - Cross-reference neighboring concepts instead of repeating generic checklists
  4. Framework-agnostic reasoning - Use products as evidence, not as the architecture
  5. Quantitative honesty - Source reported figures and label illustrative assumptions
  6. Verifiable decisions - Include failure traces, observability, rollout, and tests

Evidence labels used throughout the fieldbook:

  • Documented - A cited primary source states the behavior for its named version or publication scope.
  • Inference - The conclusion follows from stated mechanisms and assumptions; it is not attributed to an undisclosed deployment.
  • Reference design - A reusable architecture proposed by this book; thresholds and worked numbers remain illustrative until measured.

Table of Contents

Part 1: Foundations

Part 2: Distributed Databases

Part 3: Storage Engines

Part 4: Caching

Part 5: Messaging

Part 6: Scaling

Part 7: Real-Time Systems

Part 8: Case Studies

Part 9: Whitepapers

Part 10: Security

Part 11: Observability and Operations

Part 12: Service Connectivity and APIs

Part 13: Data Pipelines

Part 14: Search Systems

Part 15: Deployment

Part 16: ML Systems

Part 17: LLM Systems

  • Agent Fundamentals: durable loops, action identity, authority, evidence, and bounded autonomy
  • Orchestration Patterns: deterministic workflows versus adaptive branches, typed state graphs, latency and cost composition
  • Multi-Agent Systems: delegation, shared state, message semantics, scheduling, and correlated failure
  • RAG Patterns: corpus publication, authorization-aware retrieval, evidence packets, grounded generation, and citation provenance
  • LLM Infrastructure: gateway and model control planes, regional admission/routing/streaming, provider and self-hosted fleets
  • Prompt Engineering: versioned request compilation, structured outputs, tool schemas, prompt-injection test boundaries
  • Fine-Tuning Patterns: method choice, dataset/release identity, serving adapters, privacy and evaluation
  • Context Management: context revisions, compaction, memory, token budgets, and concurrency
  • Harness Engineering: action transactions, permission boundaries, sandbox/secret broker, recovery and rollout
  • LLM Evaluation and Observability: estimands, datasets, calibrated evaluators, uncertainty, traces and production feedback
  • GPU Inference Internals: phase rooflines, KV/device memory, kernels, parallelism, and accelerator isolation
  • Agent Inference: multi-turn session scheduling, KV residency, cache-aware routing, fan-out and task-level goodput

Part 18: Workflow & Job Systems

Part 19: Engineering Systems for Coding Agents

Notation

Symbol Meaning
N Total nodes/replicas
W Write quorum size
R Read quorum size
f Failures tolerated

References

Books

Book Author Topics
Designing Data-Intensive Applications Martin Kleppmann Replication, partitioning, transactions, distributed systems
System Design Interview Vol. 1 Alex Xu Rate limiting, consistent hashing, key-value stores
System Design Interview Vol. 2 Alex Xu Real-world systems, proximity services, stock exchange
Database Internals Alex Petrov B-trees, LSM trees, storage engines, distributed databases
Understanding Distributed Systems Roberto Vitillo Networking, coordination, scalability, resiliency
Building Microservices Sam Newman Service decomposition, integration, deployment

Original Papers

Distributed Systems Foundations

Storage & Databases

Consensus & Coordination

Messaging & Streaming

Social & Web Scale

NewSQL

Engineering Blogs

Company Notable Posts
Netflix Tech Blog Microservices, chaos engineering, streaming
Uber Engineering Real-time systems, geospatial, scaling
Meta Engineering TAO, distributed systems, ML infrastructure
Stripe Engineering API design, idempotency, payments
Cloudflare Blog Edge computing, DNS, DDoS mitigation
Discord Engineering Real-time messaging, voice, scaling
Slack Engineering Messaging architecture, search, reliability
Dropbox Tech Blog Sync, storage, infrastructure
Pinterest Engineering Recommendations, search, scaling
LinkedIn Engineering Kafka, data infrastructure, ML
Twitter Engineering Timeline, real-time, graph processing
Spotify Engineering Streaming, personalization, microservices
GitHub Engineering Git internals, availability, scaling
Shopify Engineering E-commerce, flash sales, payments

Online Resources

Resource Description
High Scalability Architecture case studies
The Morning Paper CS paper summaries (archived)
Papers We Love Community for reading CS papers
Distributed Systems Reading List Curated paper collection
System Design Primer Popular GitHub resource
ByteByteGo Visual system design explanations
Awesome Distributed Systems Curated resources list

Video Lectures

Course Institution Topics
MIT 6.824: Distributed Systems MIT MapReduce, Raft, Spanner, distributed transactions
CMU 15-445: Database Systems CMU Storage, indexing, query processing, concurrency
CMU 15-721: Advanced Database Systems CMU In-memory databases, query optimization
Stanford CS244B: Distributed Systems Stanford Consensus, replication, distributed storage

Additional Books

Architecture & Design Patterns

Book Author Topics
Clean Architecture Robert C. Martin Dependency rule, boundaries, components, frameworks
Patterns of Enterprise Application Architecture Martin Fowler Domain logic, data source, web presentation patterns
Domain-Driven Design Eric Evans Bounded contexts, aggregates, ubiquitous language
Implementing Domain-Driven Design Vaughn Vernon Practical DDD patterns and techniques
Release It! Michael Nygard Stability patterns, capacity, networking
Software Architecture: The Hard Parts Ford, Richards, Sadalage, Dehghani Trade-off analysis, modularity, decomposition
Fundamentals of Software Architecture Mark Richards, Neal Ford Architecture styles, characteristics, decisions
A Philosophy of Software Design John Ousterhout Complexity, modules, abstractions, comments

Distributed Systems & Reliability

Book Author Topics
Site Reliability Engineering Google SLOs, error budgets, toil, monitoring, on-call
The Site Reliability Workbook Google Practical SRE implementation
Distributed Systems Tanenbaum & Van Steen Processes, communication, naming, coordination
Designing Distributed Systems Brendan Burns Patterns for scalable, reliable services
Database Reliability Engineering Campbell & Majors Database operations, infrastructure, recovery
Web Scalability for Startup Engineers Artur Ejsmont Practical scaling strategies

Data & Streaming

Book Author Topics
Streaming Systems Akidau, Chernyak, Lax Watermarks, windows, triggers, exactly-once
Kafka: The Definitive Guide Shapira, Palino, et al. Kafka internals, producers, consumers, operations
Making Sense of Stream Processing Martin Kleppmann Event sourcing, change capture, stream processing
Data Mesh Zhamak Dehghani Decentralized data architecture
The Data Warehouse Toolkit Ralph Kimball Dimensional modeling, ETL, BI

Performance & Optimization

Book Author Topics
Systems Performance Brendan Gregg Linux, observability, methodologies, tools
BPF Performance Tools Brendan Gregg Linux BPF observability and tracing
High Performance MySQL Silvia Botros, Jeremy Tinley Query optimization, replication, scaling
High Performance Browser Networking Ilya Grigorik TCP, UDP, TLS, HTTP/2, WebSocket, WebRTC

More Papers

Consistency & Transactions

Distributed Data Structures

Search & Indexing

Machine Learning Systems

Container & Orchestration

License

MIT License

About

Comprehensive system design patterns documentation with code examples

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages