X's system design
☰
X is a write-once, read-millions system: a post is stored once and then has to show up in millions of feeds — Twitter pre-built those feeds when a tweet was written, X's For You feed is assembled when you open it.
+ The whole system in one paragraph− Hide
X stores every post once, then must show it in millions of feeds, so reading is the hard part. Twitter (2012–2017) did that work up front: it copied each new tweet's ID into every follower's ready-made timeline in memory, so opening the app was one lookup. X's For You feed is instead built fresh each time you open it.
In this lesson
3 chapters · ~7 min · a quick check in eachEverything is on this page — just scroll down ↓
The whole system
What it must do — and how well
Post a tweet, build a timeline
A tweet is stored once (top) and its ID copied into each follower's prebuilt timeline (middle). For You is assembled on each request (bottom), so nothing is copied per follower.
You post a tweet. It goes to the write API.
Curious? Go deeper+ 1 optional
Under every box: network, data centers, services
A request enters Twitter's own network near you, rides its backbone to a data center, and services call each other through one shared library that routes around failures (2013).
6 steps. Follow the flow one step at a time — what happens first, and what comes next.
Twitter made 30B tweet deliveries into timelines a day (2012). About how many deliveries a second is that?
Pick one — or just keep scrolling, it's not graded.
Keep going — it's free
Create your free account to unlock the rest of X / Twitter's system design, keep your progress and pick up right where you left off.
- 2Posting & timelines
- 3Growth & failures
Ask anything about this system, or share how you'd design it.
Log in to join the conversation