Search⌘ K
AI Features

Requirements of Instagram’s Design

Explore the critical functional and non-functional requirements for designing Instagram, a read-heavy, high-scale service. Calculate resource needs, including petabytes of storage and terabits of bandwidth, using precise back-of-the-envelope methods. Use these constraints to inform the high-level System Design decisions.

Requirements

We will focus on core features to simplify the design. The system requirements are:

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 news feed: The users can view the news feed 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 news feed.

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 news feed 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 is 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.

AI Powered
Saved
5 Attempts Remaining
Reset
Functional requirements
Suppose we wanted to implement a time-based expiration feature for the content on Instagram (like Snapchat). What functional requirements would we need to add or remove to reflect this feature?

Resource estimation

The system is read-heavy because users browse feeds far more often than they create posts. Design priorities include storage efficiency and low-latency feed retrieval. Instagram supports roughly 1 billion users who share about 95 million posts per day.

We make the following assumptions:

  • Total users: 1 billion (500 million daily active users)

  • Daily uploads: 60 million photos and 35 million videos

  • File sizes: Max 3 MB per photo, 150 MB per video

  • Traffic: Average 20 requests per user/day

Storage estimation

We estimate storage, bandwidth, and server count based on these figures.

Daily storage requirements:

60 million photos/day×3 MB=180 TB/day\text{60 ...