Practice: Design Social Media
Global social media platform with posts, media, follows, feeds, search, notifications, recommendations, and moderation.
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
- Create, read, like, and comment on posts (text, images, short videos).
- Follow/unfollow users; timelines show posts from follows and recommendations.
- Media upload with background processing (transcode/thumbnail) and CDN delivery.
- Real-time notifications for likes, comments, follows, and mentions.
- Search users, hashtags, and posts; trending and explore discovery pages.
- Content moderation (automated + manual review) for policy violations.
- Profile pages with stats; edit profile, avatars, and bios.
- Session management and secure authentication across devices.
Non-functional requirements
- Availability: 99.95%+; single instance or AZ failure must not disrupt timelines.
- Performance: p99 timeline read < 150 ms cache-warm; post publish visible to followers < 5 s p95.
- Scalability: independently scale feed, social graph, and media; support millions of DAU.
- Durability: posts and interactions persisted with transactional guarantees and backups.
- Consistency: strong for auth/profile writes and post creation; eventual for feed fan-out and search indexing (< 30 s).
- Security: TLS 1.2+; signed media URLs; principle of least privilege; secrets in KMS.
- Resilience: timeouts/circuit breakers; retries with backoff; DLQs for poison messages.
- Observability: traces/logs/metrics for API, feed fan-out latency, queue depth, and error rates.
- Privacy: GDPR/CCPA compliance; PII encryption at rest (AES-256).