Design of Instagram

Lesson 149 of 25610 min readPremium lesson preview
In this lesson2 sections

Design of Instagram

Define the API and metadata model for the media-sharing exercise. Keep object bytes separate from their records, and make visibility, retry handling, and pagination part of the contract.

High-level design

The system must support uploading, viewing, and searching media. Additionally, users can follow one another. This requires a robust storage layer to persist media and a retrieval mechanism to fetch data on demand.

The high-level design of Instagram
The high-level design of Instagram

API design

We will implement REST APIs for the following features:

  • Post photos and videos

  • Follow and unfollow users

  • Set or remove a like

  • Search photos and videos

  • Generate a news feed

The sketches include a userID, but the server must derive or validate the actor using authentication. Repeating a post or relationship mutation needs a stable identity or desired-state operation. Client-supplied user IDs alone are not authorization.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.