Design a News Feed System
Twitter/Facebook-like Timeline with Real-time Updates & Personalization
System Design Challenge
Build a scalable social media timeline system serving 300M users with personalized content ranking, efficient fan-out strategies for celebrity users, real-time updates, and sub-200ms timeline generation. Handle 500M tweets/day with advanced ML-driven content personalization.
❓ Clarifying Questions & Requirements
What type of social media platform are we designing?
A Twitter-like microblogging platform with short-form content, following relationships, and real-time updates.
Key Insight: Focus on text posts with media attachments. Users follow each other to see content in personalized timelines.
What's the expected scale of users and content?
300M daily active users posting 500M tweets per day globally.
Key Insight: Peak traffic during major events can reach 150M concurrent users. Average user follows 150 accounts and checks timeline 30 times daily.
What are the core features beyond basic posting?
Personalized timeline, likes/retweets/replies, real-time notifications, trending topics, search, and media uploads.
Key Insight: Include advanced features like algorithmic ranking, spam detection, and content moderation at scale.
How should we handle celebrity users with millions of followers?
Special handling required - some users have 50M+ followers creating massive fan-out challenges.
Key Insight: Need hybrid fan-out strategies to prevent system overload while maintaining real-time delivery for active users.
What are the performance and consistency requirements?
Timeline loads must be <200ms, 99.9% availability, eventual consistency acceptable for social content.
Key Insight: Real-time updates preferred for active users, but slight delays acceptable for inactive users. Global distribution required.
How important is content personalization vs chronological ordering?
Hybrid approach - blend algorithmic ranking with recency. Users should see most relevant content first.
Key Insight: Ranking algorithm should consider engagement likelihood, relationship strength, content quality, and trending signals.