The basics

The System Design Primer

The basics of system design in short chapters. Start with scaling, end with AI systems. Read them in order or jump to the one you need.

~2 hr read | Free to read
01

Scalability

The difference between fast and able to grow, and how to make a system handle more users.

Read this chapter
02

Availability & Consistency

The CAP theorem, what happens when a server dies, and how copies of data stay in step.

Read this chapter
03

DNS & CDN

How a name like sdprimer.com turns into a server address, and how CDNs put files closer to users.

Read this chapter
04

Load Balancing

How to spread traffic across many servers, Layer 4 versus Layer 7, and what a reverse proxy does.

Read this chapter
05

Databases

SQL versus NoSQL, ACID versus BASE, and how to split a database when it gets too big.

Read this chapter
06

Caching

Where to keep a copy of hot data, when to throw it out, and how to keep it correct.

Read this chapter
07

Async & Queues

Queues, background jobs, and how to stop making users wait for slow work.

Read this chapter
08

Communication

HTTP, TCP, UDP, REST, and RPC. How services talk to each other and which to pick.

Read this chapter
09

Security

Encryption, checking input, giving each part only the access it needs, and layers of defense.

Read this chapter
10

AI System Design

A system with a language model inside: the request path, time to first token, GPU capacity, token cost, RAG, agents, and evals.

Read this chapter

Ready to practice?

Answer one question a day on this site. The first one takes two minutes.

Try a question