Database Design for TikTok System Design
Below is the explanation of the above database design:
7.1 Users Database
User
{
UserID (Primary Key)
Username
Email
Password (Hashed)
Profile Picture URL
Bio
Registration Date
}
|
- UserID: Unique identifier for users.
- Username: Name chosen for user identification.
- Email: User’s email address used for registration.
- Password: Securely hashed user password.
- Profile Picture URL: Link to the user’s profile image.
- Bio: Brief description or biography of the user.
- Registration Date: Date when the user signed up.
7.2 Social Graph
SocialGraph
{
UserID (Primary Key)
Follower IDs (Array/Map)
Following IDs (Array/Map)
Additional Graph Information
}
|
- UserID: Unique identifier for users.
- Follower IDs: Ds of users following the current user.
- Following IDs: IDs of users followed by the current user.
- Additional Graph Information: Supplementary data related to the social graph.
7.3 Videos Database
Video
{
VideoID (Primary Key)
UserID (Foreign Key to Users)
Title
Description
Upload Date
Views Count
Duration
Other Metadata
}
|
- VideoID: Unique identifier for each uploaded video.
- UserID: Foreign key linking the video to its uploader.
- Title: Name or title of the uploaded video.
- Description: Brief description of the video content.
- Upload Date: Date when the video was uploaded.
- Views Count: Number of views the video has received.
- Duration: Length of the video in time.
- Other Metadata: Supplementary data associated with the video.
7.4 Interactions Database
Likes
{
LikeID (Primary Key)
UserID (Foreign Key to Users)
VideoID (Foreign Key to Videos)
Timestamp
Additional Like Information
}
|
- LikeID: Unique identifier for each like action.
- UserID: Foreign key linking the like to the user.
- VideoID: Foreign key linking the like to a specific video.
- Timestamp: Time when the like was made.
- Additional Like Information: Extra data associated with the like action.
Dislikes
{
DislikeID (Primary Key)
UserID (Foreign Key to User)
VideoID (Foreign Key to Video)
Timestamp
}
|
- DisikeID: Unique identifier for each dislike action.
- UserID: Foreign key linking the like to the user.
- VideoID: Foreign key linking the like to a specific video.
- Timestamp: Time when the like was made.
- Additional Like Information: Extra data associated with the dislike action.
Comments
{
CommentID (Primary Key)
UserID (Foreign Key to Users)
VideoID (Foreign Key to Videos)
Comment Text
Timestamp
Additional Comment Information
}
|
- CommentID: Unique identifier for each comment.
- UserID: Foreign key linking the comment to the user.
- VideoID: Foreign key linking the comment to a specific video.
- Comment Text: Text content of the user’s comment.
- Timestamp: Time when the comment was made.
- Additional Comment Information: Supplementary data related to the comment.
Designing TikTok | System Design
TikTok, the globally acclaimed video-sharing platform, enchants audiences with its short, captivating content. Behind this phenomenon lies a sophisticated system meticulously designed to handle vast user-generated videos, likes, and personalized recommendations. From video uploads to tailored feeds, TikTok’s design weaves together smart technologies and algorithms, ensuring a seamless experience.
Important Topics for Designing System Design
- What is TikTok?
- Requirements for TikTok System Design
- Capacity Estimation of TikTok System Design
- Use Case Diagram for TikTok System Design
- Low-Level Design(LLD) for TikTok System Design
- High-Level Design for TikTok System Design
- Database Design for TikTok System Design
- Types of Databases used in TikTok Design
- API Used for Communicating with the servers in TikTok System Design
- Microservices used in TikTok System Design
- Scalability in TikTok System Design