SD-15 · NEWS FEED · INTERACTIVEBreak it.
Break it.
Then fix it.
Turn up the feed loads, watch what melts, and add the parts a real social feed needs. One post is written for every 20 feed loads, and a few accounts have millions of followers.
CHALLENGEServe 100K feed loads/s with p99 under 200 ms, fan-out under 10 s and no missing posts.
StatusSTRAINEDAt 20K feed loads per second
Feed p99162 msTarget under 200 ms
Fan-out lag5 sSome posts never arrive
Errors0%Nothing dropped
Monthly cost$29,800Feeds precomputed
UsersLIVE
20K feed loads/s · 1.0K posts/straffic source
Feed + post API × 40OK
Reads one timeline20K / 400K loads/s
Feed cache × 32MISSING
300 post ids per user620K / 4.8M ops/s
Fan-out workersOK
Every follower of every author600K / 1M writes/s
Fan-out queueOK
Sent after the insert1.0K events/s
Post storeHOT
Hydration reads400K / 500K reads/s
Some posts never reach anyone’s feed. The API stores the post, then sends the fan-out event. A crash between the two loses the post from every feed. Drive fan-out from the post store’s change stream instead.
20 : 1Feed loads per postReads dominate, so precomputing feeds pays off.
600 → 120Writes per postSkipping celebrities and inactive followers cuts fan-out 5×.
2M/sPost lookups at peak100,000 feeds × 20 posts; the post cache takes 95%.
100KCelebrity lineFollowers above which posts are pulled, not pushed.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.