System Design — Instagram

Dingding Wang
7 min readSep 25, 2019

Product Requirements

  1. [Post] User can create a post (image + text (optional))
  2. [Post] User can comment on a post
  3. [Post] User can like a post
  4. [Feed] User can get follow feed ordered by time (landing page)
  5. [Feed] User can get profile feed of another user ordered by time

The above functionalities can be grouped into two: post and feed.

Follow feed is the default landing point, thus has to handle heavy traffic. It’s worth to put much engineer effort to it.

Non-product Requirements

  1. Performance: low latency, follow feed should be fast cause it’s the landing point
  2. Persistency: contents uploaded by user must not be lost
  3. Accuracy: order of post and number of likes user receives can be less strict.

Interface/API

  1. create_post(user_id, image, text, timestamp) -> success/failure
  • assume every post has an image, and optional text

2. comment_post(user_id, post_id, comment, timestamp) -> success/failure

  • assume you can comment on a post, but not on another comment

--

--

Dingding Wang

Former Yelper, now a Snapchatter. Focus on Payment transaction system, Search system, Web API server and Internationalization.