System Design: Instagram-like Photo and Short-Video Platform
Goal
Design an Instagram-like platform for photos and short videos. The design should cover product features, scale assumptions, APIs, storage, feed/ranking, media handling, and operational concerns.
Functional Requirements
-
Post: create, edit (caption), delete; single image or short video; hashtags, mentions, location
-
Follow graph: follow/unfollow; follower and following lists
-
Interactions: like/unlike, comment/delete, counts
-
Feed: home timeline combining followed accounts and recommendations; infinite scroll; pagination
-
Notifications: likes, comments, follows, mentions; push and in-app
-
Profiles: public/private accounts; block/mute; profile media grid
Non-Functional Goals
-
Availability: high availability across regions for read path (feed/media). State explicit SLOs.
-
Latency: sub-200 ms p95 for metadata APIs; smooth media playback
-
Scalability: support 100M+ DAU; elastic fan-out; hot accounts handling
-
Consistency: read-your-writes for own actions; eventual for others; clear timeline semantics
Deliverables
-
APIs (CRUD for posts, follow, like, comment, feed, notifications)
-
Data model and storage choices
-
Media handling: upload, transcode, storage, CDN
-
Feed generation and ranking pipeline
-
Timeline consistency model
-
Caching and search
-
Sharding/partitioning and replication
-
Background jobs (fan-out, media processing)
-
Rate limiting and abuse prevention
-
Privacy/permissions model
-
Observability (metrics, logs, traces), disaster recovery
-
Back-of-the-envelope capacity: QPS, storage, bandwidth, and rough cost
Estimation
-
State reasonable scale assumptions (e.g., MAU/DAU, posts/day, follower distribution) and compute QPS, storage, and bandwidth.
-
Justify any additional assumptions you make.