Practice: Design News Feed
Personalized home feed inspired by Facebook's and Twitter's published designs: fan-out on write into precomputed feeds, hybrid pull for high-follower accounts, ranking at read time, plus search and trending. A teaching design, not either company's internal architecture.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Display a personalized feed aggregating posts from followed users, ranked by recency and engagement.
- Allow users to publish posts (text, images, videos) distributed to all followers.
- Support likes, comments, and shares on posts in real-time.
- Show trending topics and hashtags based on engagement volume in the last hour.
- Allow full-text search of posts by keyword, hashtag, author, and date range.
- Support infinite scroll with cursor-based pagination.
- Send push/email notifications to followers when someone they follow posts.
Non-functional requirements
- Feed read latency: p99 < 300ms for pre-computed cached feed.
- Post publish response: < 100ms (async fanout, not blocking).
- Fanout propagation: new post visible to all followers within 5 seconds (eventual consistency).
- Search latency: p99 < 200ms for keyword/hashtag queries.
- Availability: 99.9%+; feed degrades gracefully (serve stale cache) on partial failures.
- Scale: 500M registered users, 100M DAU, 1B posts/day.
- Media serving: p99 < 50ms for images/video via CDN.