Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 03

Design a photo sharing app

Intermediate · 45 min · Feeds & social graphs

Someone takes a photo on their phone, adds a caption and posts it. Their followers open the app later and scroll a home feed of recent posts from everyone they follow, with images that load as fast as they scroll.

Requirements

  • Upload a photo with a caption from a mobile app and publish it as a post.
  • Follow and unfollow other accounts.
  • Show a home feed of recent posts from followed accounts, newest first, paginated.
  • Show a profile grid of one account's posts.

Constraints and assumptions

  • 200 million daily active users; 50 million new posts a day, peaking at about 2,000 posts per second.
  • Originals average 3 MB from the phone; the app displays 4 sizes (150 px thumbnail up to 1080 px).
  • Each active user opens the feed about 20 times a day; feed metadata p99 under 300 ms, not counting image download.
  • The median account has 200 followers; a few thousand accounts have over 10 million.
  • A new post should reach followers' feeds within 10 seconds for ordinary accounts.

Out of scope for the first sketch

Video and stories · Ranking the feed (keep it reverse-chronological) · Comments, likes and direct messages

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches