Database Design for TikTok System Design

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

Similar Reads

1. What is TikTok?

TikTok is a social Media Platform that is used to make a variety of short-form videos, from genres like dance, comedy, and education, that have a duration of 15 seconds to one minute. The app, developed by the Chinese company ByteDance, gained widespread popularity for its user-friendly interface and the ability to easily create and share engaging content....

2. Requirements for TikTok System Design

...

3. Capacity Estimation of TikTok System Design

To estimate the scale of the system and to get the idea about the storage requirements, we have to make some assumptions about the data queries and the average size of videos uploaded....

4. Use Case Diagram for TikTok System Design

For the TikTok-like application, there are two distinct user scenarios:...

5. Low-Level Design(LLD) for TikTok System Design

...

6. High Level Design for TikTok System Design

At a high level, the design should handle two main tasks....

7. Database Design for TikTok System Design

Database Design for TikTok System Design...

8. Types of Databases used in TikTok Design

...

9. API Used for Communicating with the servers in TikTok System Design

...

10. Microservices used in TikTok System Design

...

11. Scalability in TikTok System Design

...