You are using an outdated browser. Please update your browser for a better user experience.

How would you create your own Instagram?

miscellaneous

Let's design a photo-sharing service like Instagram, where users can upload photos to share them with other users. Plan to design a simpler version of Instagram for this design problem, where a user can share photos and follow other users. The ‘News Feed’ for each user will consist of top photos of all the people the user follows.

Focus on the following set of requirements while designing Instagram:

Functional Requirements

  • Users should be able to upload/download/view photos.
  • Users can perform searches based on photo/video titles.
  • Users can follow other users.
  • The system should generate and display a user’s News Feed consisting of top photos from all the people the user follows.

Non-functional Requirements

  • Our service needs to be highly available.
  • The acceptable latency of the system is 200ms for News Feed generation.
  • Consistency can take a hit (in the interest of availability) if a user doesn’t see a photo for a while; it should be fine.
  • The system should be highly reliable; any uploaded photo or video should never be lost.

Not in scope: Adding tags to photos, searching photos on tags, commenting on photos, tagging users to photos, who to follow, etc.

The system would be read-heavy, so we will focus on building a system that can retrieve photos quickly.

  1. Practically, users can upload as many photos as they like; therefore, efficient management of storage should be a crucial factor in designing this system.
  2. Low latency is expected while viewing photos.
  3. Data should be 100% reliable. If a user uploads a photo, the system will guarantee that it will never be lost.