200×
feed writes for every post you push
Assume about 300 followers, two-thirds active this week. A billion posts a day becomes 2.3 million list inserts a second, 7 million at peak.
Who pays: writer or reader?
Bad: Pull on every open
300 followee lookups per page, 138M a second at peak.
Good: Push IDs to live lists
≈ 200 inserts per post. A feed open is one memory read.
Push or pull? It depends on the pair.
Push when the reader looks often compared with how often the author posts. Deciding pair by pair minimises the total cost.
A film star posts to 100M followers. Pushing it eats 43 seconds of the whole fan-out fleet.
The trick
Don’t push. Hot accounts write to one cached outbox; readers pull about ten and merge.
1,000 candidates, 20 slots, about 180 ms
Cheap passes protect the expensive one. Filters, a light model keeps 500, a heavy model scores them, then diversity rules fill the page.
Three friends post while you scroll. Page 2 repeats.
Offsets shift under new posts. Instead, rank once per session, store the 500 IDs as a snapshot, and page with a cursor into it.
Deletes and privacy: filter, don’t retract
- Feeds hold IDs, never copies of posts
- Check the live post at every hydration
- Hydrate 24 to show 20
- Retract only reader-side changes, like unfollows
Remember
Push IDs to active readers, pull from hot authors. Rank once per session, page a snapshot, and check privacy on the live post.