← Questions

Design Instagram: photo sharing with a follower feed

0
GoogleMetaMicrosoft+2System designLast asked May 2026

Design a photo and video sharing app like Instagram. Users post photos and videos, follow each other and scroll a feed of posts from people they follow. Cover upload, storage, feed generation and serving media fast worldwide.

Requirements

  • Functional: upload photos and videos with captions; follow and unfollow; a home feed of posts from followed accounts, newest or ranked; likes and comments; user profiles with their posts.
  • Non-functional: hundreds of millions of users; far more reads than writes; feed loads in well under a second; media served quickly worldwide; accounts with many millions of followers.

Clarifying questions

  • How many daily users, posts per day and feed views per day?
  • Chronological or ranked feed?
  • Do we need stories, reels, direct messages, or only the main feed?
  • What video lengths and quality?
  • How quickly must a new post appear in followers' feeds?

What a strong answer covers

  • Upload: direct upload to object storage, then processing into several sizes and formats, served through a CDN.
  • Data model: users, posts, follows (a graph partitioned by user), likes and comments.
  • Feed generation: fan-out on write into each follower's feed cache vs fan-out on read; the hybrid where accounts with huge followings are merged at read time.
  • Ranking: candidate generation from the feed cache, a ranking model, and caching the result.
  • Storage choices and partitioning for posts and the follow graph; counters for likes at scale.
  • Global serving: CDN, regional caches and replicas, and what happens when a region fails.

Follow-ups

  • A celebrity with 100 million followers posts. What happens?
  • A user follows 5,000 accounts.
  • Delete a post everywhere, including caches and the CDN.
  • Add an Explore page of posts from people the user does not follow.
Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing