Design the architecture for TikTok - the fastest-growing content platform with 1.5 billion monthly active users watching an average of 95 minutes per day. Your design must cover:
- Video creation & upload - users record or upload short videos (15 seconds to 10 minutes) with effects, filters, music overlays, and text. Videos are encoded to multiple resolutions (360p to 1080p) and formats.•For You feed (FYF) - the most critical feature. Unlike follower-based feeds (Twitter, Instagram), TikTok's feed is entirely algorithm-driven. An ML recommendation system selects videos based on user engagement signals (watch time, likes, shares, scroll-away speed), creator features, and video content features. The feed is an infinite scroll of personalized content.•Content moderation - AI-powered moderation must review every video before it reaches the FYF. Detect nudity, violence, hate speech, misinformation, and copyright violations. Moderation must complete within 5 minutes of upload for fast time-to-virality.•Viral distribution - a video can go from 0 to 10 million views in hours. The CDN must handle explosive, unpredictable traffic patterns. Newly popular videos must be pushed to edge caches proactively.•Music/sound library - searchable catalog of millions of songs and original sounds. Link videos to their source audio for "use this sound" feature.•Engagement - likes, comments, shares, duets (side-by-side reaction videos), and stitches (appending to another video).•Creator analytics - real-time view counts, follower growth, demographic breakdowns for content creators.
The core challenge is the recommendation-first architecture where the feed quality is the product.
Design TikTok's short-video platform - video creation, For You feed, content moderation, and viral distribution for 1 B+ users. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Mobile Clients -> DNS -> CDN Edge -> Load Balancer -> Core Service -> Primary NoSQL DB -> Redis Cache -> Event Bus