TikTok database schema

How a short-video app models its data: sounds as first-class rows reused across videos, duets and stitches as self-references, an append-only watch-event log feeding a recommendation feed, plus follows, likes, comments and hashtags.

Tiktok ER diagram

TikTok database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT usernameVARCHAR display_nameVARCHAR bioVARCHAR is_privateBOOLEAN follower_countINTEGER following_countINTEGER video_countINTEGER total_like_countBIGINT created_atTIMESTAMP sounds idBIGINT titleVARCHAR artist_nameVARCHAR kindVARCHAR original_video_idBIGINT duration_msINTEGER storage_keyVARCHAR use_countBIGINT is_availableBOOLEAN created_atTIMESTAMP videos idBIGINT author_idBIGINT sound_idBIGINT sound_start_msINTEGER captionVARCHAR storage_keyVARCHAR duration_msINTEGER duet_of_video_idBIGINT stitch_of_video_idBIGINT stitch_start_msINTEGER allow_duetBOOLEAN view_countBIGINT like_countINTEGER comment_countINTEGER share_countINTEGER published_atTIMESTAMP deleted_atTIMESTAMP follows follower_idBIGINT followee_idBIGINT notify_on_postBOOLEAN created_atTIMESTAMP video_likes video_idBIGINT user_idBIGINT created_atTIMESTAMP comments idBIGINT video_idBIGINT author_idBIGINT parent_comment_idBIGINT bodyVARCHAR like_countINTEGER is_creator_pinnedBOOLEAN created_atTIMESTAMP watch_events idBIGINT viewer_idBIGINT video_idBIGINT sourceVARCHAR watched_msINTEGER completion_ratioREAL loop_countSMALLINT skipped_earlyBOOLEAN watched_atTIMESTAMP hashtags idBIGINT tagVARCHAR video_countBIGINT view_countBIGINT created_atTIMESTAMP video_hashtags video_idBIGINT hashtag_idBIGINT positionSMALLINT user_topic_affinity user_idBIGINT hashtag_idBIGINT scoreREAL watch_secondsINTEGER updated_atTIMESTAMP sound_favorites sound_idBIGINT user_idBIGINT saved_atTIMESTAMP

Related database schemas