Design Instagram

Explore the design of Instagram in detail.

Instagram is a free social networking application that allows users to post photos and short videos. Users can add a caption for each post and utilize hashtags or location-based geotags to index posts and make them searchable within the application.

A user’s Instagram posts display in their followers’ feeds and can be seen by the general public if they are tagged with hashtags or geotags. Alternatively, users can choose to make their profile private, which limits access to those who have chosen to follow them.

Requirements

We’ll concentrate on some important Instagram features to simplify this design. Let’s list down the requirements for our system.

Functional requirements

  • Post photos and videos: The users can post photos and videos on Instagram.

  • Follow and unfollow users: The users can follow and unfollow other users on Instagram.

  • Like or dislike posts: The users can like or dislike posts of the accounts they follow.

  • Search photos and videos: The users can search photos and videos based on captions and location.

  • Generate newsfeed: The users can view the newsfeed consisting of the photos and videos in chronological order from all the users they follow. Users can also view suggested and promoted photos in their newsfeeds.

Non-functional requirements

  • Scalability: The system should be scalable to handle millions of users in terms of computational resources and storage.

  • Latency: The latency to generate a newsfeed should be low.

  • Availability: The system should be highly available.

  • Durability: Any uploaded content (photos and videos) should never get lost.

  • Consistency: We can compromise a little on consistency. It’s acceptable if the content (photos or videos) takes time to show in followers’ feeds located in a distant region.

  • Reliability: The system must be able to tolerate hardware and software failures.

Building blocks we will use

The Instagram design utilizes the following building blocks discussed in the elementary design problems.

Press + to interact
Building blocks used in Instagram design
Building blocks used in Instagram design
  • load balancer at various layers will ensure smooth requests distribution among available servers.

  • database is used to store the user and accounts metadata and relationship among them.

  • ...