Open SystemDecoder on a larger screen to build systems, run simulations, and inject chaos.
What's waiting for you on desktop
Live Simulations
Watch latency spike, queues fill, and nodes fail in real time. Every slider change is instant.
Visual Architecture Canvas
Drag nodes, draw edges, and build any distributed system topology from scratch.
Chaos Engineering
Kill servers, introduce packet loss, throttle CPUs โ and watch your system react.
Real-time Insights
Throughput, p99 latency, error rates โ all charted live as your simulation runs.
40+
Concepts
<1s
Feedback
โ
Replays
"The best way to understand a distributed system
is to break it."
๐ฆ
@alice just opened Twitter
500 accounts followed ยท timeline in <100ms?
@alice follows 500 accounts. When she opens Twitter, she expects her personalised feed in under 100ms. Behind the scenes, those 500 accounts may have posted thousands of tweets.
How do you assemble a fresh, relevant, personalised feed instantly at scale? The answer depends entirely on how you deal with the fanout problem.
Request Flow
The naive approach
Query the for every account @alice follows. Merge and sort results. Works fine with 10 follows โ catastrophic with 500.
// Fanout-on-read (pull): SELECT posts FROM tweets WHERE author_id IN (followee_1, ..., followee_500) ORDER BY created_at DESC LIMIT 20 // โ 500 index lookups + merge sort every feed load
The pre-computation approach
Instead of reading at query time, write the tweet to every follower's timeline cache at post time. Feed reads become a single cache lookup โ but writes become expensive.
// Fanout-on-write (push):
On POST /tweet:
for each follower:
LPUSH timeline:{followerId} tweetId
LTRIM timeline:{followerId} 0 800
// โ N Redis writes per tweet (1 post x N followers)Why We Need This
The choice between push and pull is the defining trade-off of any feed system. Over the next six steps you'll build both and understand why production systems like Twitter use a hybrid of both.
Key Insight
Feed systems make a fundamental choice: pay the cost at write time (push) or at read time (pull). Each has a failure mode โ push creates write amplification, pull creates read amplification. The hybrid model routes each post by follower count.
Overview