Continue where you left off ×
Everything · Open board
The whole set on one board. The map and the seven problems it’s built from are linked below.
Boards
Before you start. All you need is the shape of a social feed: you post something, and the people who follow you expect to see it soon after. This lesson is about what happens to that simple idea once “the people who follow you” ranges from three hundred to a hundred million.
The idea in 30 seconds
Reading a feed happens far more often than posting, so doing the expensive work at post time (push) beats doing it at read time (pull) almost everywhere.
Push breaks the moment an account’s followers number in the tens or hundreds of millions, because all of that work lands in a single instant.
The fix isn’t picking one for the whole platform: it’s splitting accounts in two, and pulling only the few huge ones in at read time, merged with everyone else’s precomputed list.
A timeline is a list of markers, not posts. Hydration fetches the real posts and their current counts at the last moment, which is what keeps a like count correct everywhere without rewriting millions of copies.
An id with the moment it was made stamped inside it can be handed out by any machine, with no coordination, and still sorts roughly by time.
Read the story
Lesson 104 of 115 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson 2008: an election, and the whale everyone remembers The two ways to build a feed, and why each one loses somewhere An ordinary Tuesday, and the post that is its own flood The trick: don’t pick one rule, split the crowd Why the list holds markers, and not the posts A number nobody has to ask permission for Retrieval (cold, no peeking) Terms it explains: marker, fan-out on write, push, timeline, hydration, shard, latency, Snowflake, when, which machine, which one, FlockDB, Earlybird, MySQL, Manhattan, Redis, fail open, not.
Review System Design
Connects to
Splitting the ledger (sharding) System Design Who holds the pen (consensus & Raft) System Design The Ledger Everyone Reads (event-driven & the log) System Design Design the Whole Thing (the interview, assembled) System Design The Right Book for the Job (databases, deeply) System Design The Slate, Properly (caching to real depth) System Design Discord, the case study System Design Instagram, the case study System Design YouTube, the case study System Design Slack, the case study System Design Cloudflare, the case study System Design Amazon, the case study System Design Netflix, the case study System Design Uber, the case study System Design Zomato, the case study System Design Google Search, the case study System Design Mark as read Saved in this browser, and to your account when you sign in.