Design of Instagram
Learn the high-level design of Instagram and understand its data model.
High-level design
Our system should allow uploading, viewing, and searching of images and videos at a high level. In image and video upload, we need to store them, and upon fetching, we need to retrieve the data from the storage. Moreover, the users should also be allowed to follow each other.
API design
This section describes APIs invoked by the users to perform different tasks (upload, like, and view photos/videos) on Instagram. We will implement REST APIs for these tasks. Let’s develop APIs for each of the following features:
- Post photos/videos
- Follow/unfollow users
- Like/dislike post
- Search photos/videos
- Generate newsfeed
All of the following calls will have a userID
, that uniquely specifies the user performing the action. We will only discuss new parameters in the calls.
Post photos/videos
The POST method is used to post photos/videos to the server from the user through the /postMedia
API.
postMedia(userID, media_type, list_of_hashtags, caption)
- media_type indicates the type of media (photo or video) in a post.
- list_of_hashtags
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy