Distributed
Systems
Time, failure and agreement between machines that can’t see each other.
Computer science fundamentals for engineers who already ship.
Build a rate limiter, a vector database, a B-tree storage engine and Raft yourself, in any of ten languages. Each stage starts where your last design breaks: a test finds the case it can’t handle, a lecture explains why, and you build the version that survives it.
Why it’s worth your eveningsAI can hand you a finished design. It can’t give you the failures that shaped it, and those are what you reach for when production breaks in a way nobody planned for.
Refill at a steady rate, allow bursts up to capacity.
Your sliding log from stage 02 was exact, and the memory test showed what exact costs: a timestamp for every request in the window. A client at 100,000 requests a minute kept 100,000 of them. The fix is to stop remembering requests and remember a budget instead.
A token bucket holds up to capacity tokens and every request spends one. Tokens drip back in at a fixed rate, so over a long window a client gets exactly that rate, but a client that has been quiet can spend a burst all at once.
You don’t need a timer. Keep the time you last looked and how many tokens you had; on each request, work out how many have dripped in since.
1func (b *Bucket) Take(now time.Time) bool {2 elapsed := now.Sub(b.last).Seconds()monotonic clock3 b.tokens = min(b.capacity, b.tokens+elapsed*b.rate)4 b.last = now5 if b.tokens < 1 {6 return false7 }8 b.tokens--9 return true10}
Line 2 is where this stage’s hardest test lives. Wall-clock time can jump backwards when NTP corrects it, and a bucket that trusts it will either mint free tokens or lock a client out.
Start here. Build the simplest thing that could work, run the suite, and let it show you what you missed.
Your sliding log was exact, and test 06 of stage 02 measured the price: 3.2 MB for one busy client. Build a limiter that remembers two numbers per client and still allows short bursts.
Accept capacity
and rate
for each client at start-up.
Let a quiet client spend up to capacity
requests at once, then reject until tokens return.
Refill continuously: half a second at 2/s is one token, not zero.
06 smooth refill08 fractional rates
Never hold more than capacity, however long a client is idle, and never share a bucket between clients.
Stay correct when the wall clock jumps, forwards or backwards.
07 clock jumps back“…but a client that has been quiet can spend a burst all at once.”
Burst size = capacity. Rate only matters after the burst. Sliding log (stage 02) had no burst at all; that was the point of it.
elapsed := now.Sub(b.last).Seconds()
Go’s time.Since
keeps the monotonic reading. Don’t round-trip through Unix(), it strips it.
refills smoothly, not in steps failing
Refill is stepwise because I floor tokens to an int on every read. Store tokens as a float, floor only when spending.
Six designs, one lineEach stage starts where the last design broke. The next opens when yours survives its tests.
Problem first, then the lectureThe brief sets the problem. After your first run, the lecture explains why your attempt broke and how the field fixed it.
Tests that refuteEach failing test is a counterexample: the input, what it expected, what you returned, and a hint if you’re stuck.
When the p99 spikes, a node drops out of the cluster, or the index stops fitting in memory, the code that was quick to generate is no help. Knowing what’s underneath is.
Every design you rely on is a repair of one that broke. Sliding windows exist because fixed windows let bursts through; Raft exists because Paxos was too hard to get right. On slowcs you retrace that path: build the simple version, watch a test break it, learn why, build the next one.
| Watching a course | Building it on slowcs | |
|---|---|---|
| Who writes the code | The instructor | You, every line |
| How you learn | The final design, explained | Your design breaks on a test, you find out why, you fix it |
| When the theory comes | Before you need it | Right after your design breaks |
| Language | Theirs | Yours: Go, Rust, C, C++, Zig, Java, Kotlin, Python, TypeScript or OCaml |
| What you have at the end | A certificate | A rate limiter, a B-tree, a Raft cluster. You built them and can explain every choice |
Projects are stations. Where two lines meet, something you built on one comes back on the other, asked a harder question.
32 projects on six lines, tied together by five interchanges. The rate limiter you build for Distributed Systems comes back in AI Infrastructure to meter tokens for a model API, and in Security as the core of a web firewall.
125Rate limiterThree lines meet here. Limit a cluster, budget tokens for a model API, then write firewall rules on top of it.
14RaftAgreement between machines, then the replication under a real database.
24Vector databaseRetrieval for a model, then an index that has to survive a crash.
Time, failure and agreement between machines that can’t see each other.
The systems around the model: retrieval, serving, caching, batching and agents.
Memory, threads and scheduling: the layer every other system stands on.
How data gets to disk, survives a crash there, and comes back fast and correct.
Build the defences yourself, so you know exactly where they give.
Metrics, logs and traces: how a running system tells you what it’s doing.
Cohort 01 is 500 engineers. Join it and you pay $29 a month for as long as you stay, whatever slowcs costs later.
That’s $240 a year less than the launch price, every year you stay. Reserving is free; you decide whether to subscribe when your line opens.
Reserve a founding seat| Cohort | Departs | Seats | Fare | Status |
|---|---|---|---|---|
| 01 Founding | January 2027 | 500 | $29 / month, for life | Boarding list open |
| Next cohorts | After launch | Open | $49 / month | Not yet scheduled |
12 of 500 seats reserved · 488 left
Reserve a seat and it lights up here.
Pick the line you want to ride first and the language you’ll build in. We’ll write once, when it opens.
Something else? Write to hello@slowcs.com
Cohort 01 opens in January 2027 and is capped at 500 engineers. Seats go to the list in the order people reserved them.
No. Reserving is free and needs no card. When your line opens you decide whether to subscribe. Founding members pay $29 a month for as long as they stay; after launch the price is $49.
Yes. You’ll get an invoice with your company’s details, so it can go on a learning budget like a book or a conference ticket.
Cancel any time from your account. The founding price stays only while you’re a member, so if you come back later you pay the price of the day.
A stage takes most people one to three evenings. There’s no schedule: the cohort opens together, then you go at your own pace.
That’s the point. slowcs is for engineers who already ship features. If you’re comfortable in one language and can read a failing test, you’re ready for stage 01.
Because that’s how the field got here. Fixed windows let bursts through, so sliding logs; sliding logs cost too much memory, so token buckets. Once you’ve watched a test break your version, the next design stops being a rule to remember and becomes the obvious fix. That’s what lets you reason about systems nobody has written a lecture on yet.
Go, Rust, C, C++, Zig, Java, Kotlin, Python, TypeScript and OCaml. The tests check what your program does, not how it’s written, so you can switch language between projects.