marqa / System Design From First Principles
System Design From First Principles From one order on one server to systems that survive millions of people.
62 open lessons · practice and review with a pass
Part 0: The first order How one request travels, how to design anything, and the numbers that change decisions.
Part 1: From one box to many Scale a single service: more servers, caches, a CDN and a clean API. Then two complete designs.
Part 2: Inside the database Open the box everyone treats as magic: pages and B+trees, the log that survives a crash, isolation, query plans, LSM trees and the NoSQL family.
How a row is stored : Where does a row physically live, and how does an index find it in three steps out of millions?The write-ahead log and crash recovery : How can a database promise your order is saved when the power fails a millisecond later?Transactions, isolation and MVCC : What can go wrong when two people change the same data at the same moment, and what does each isolation level actually prevent?Query plans and indexes in practice : Why is the same query fast one day and slow the next, and which index would fix it?LSM trees and the NoSQL family : How do stores built for heavy writes work, and what are document, wide-column, key-value, graph, search and time-series stores each good at?Choosing a data model : Relational, document or wide-column: how do you choose, and when should you copy data instead of joining it?
Part 3: Data that will not fit on one machine Copies, slices, agreement: replication, partitioning, consistency and consensus, then a store and a cache built from them.
Part 4: Many people talking at once Asynchronous work and real-time delivery, then four designs that depend on them.
Part 5: Big files and endless streams Logs and Kafka from the inside, then video, file sync and crawling, and seeing inside it all.
Part 6: Scarce things and real money Where things are, who gets the last one, and money that must never be wrong across several services.
Part 7: Working together, everywhere Surviving failure, editing together, serving an LLM, and going global.
Part 8: Running it for real Change it without downtime, size it and pay for it, secure it, and write the decision down. Then design on your own.
Side quests Classic designs, each grown from a lesson you already know.
Unique ID generator : How do many machines hand out unique, roughly time-ordered ids without asking each other?Real-time leaderboard : How do you rank 200,000 people live and show anyone their position instantly?Ad-click aggregation : How do you count clicks per minute correctly when events arrive late and twice?S3-like object store : How do you keep petabytes safe without storing everything three times?Distributed email : How do you store years of mail cheaply and still search it in a second?Maps and routing : How do you find the fastest route across a city graph of millions of roads in milliseconds?Digital wallet : How do you build a balance that can always be proved, event by event?Stock exchange : How does an exchange order millions of bids fairly in microseconds?Distributed job scheduler : How do you run every scheduled job once, on time, when machines die?Spanner and TrueTime : How can a database spread over continents still order every transaction?
Open the course