Pinterest database schema

How a visual bookmarking app models its data: images deduplicated by content hash, pins as saves rather than uploads, repins as a self-reference to the source pin, boards with sections and collaborators, follows of both people and boards, and saved searches.

Pinterest ER diagram

Pinterest database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT usernameVARCHAR emailVARCHAR display_nameVARCHAR aboutVARCHAR follower_countINTEGER pin_countINTEGER created_atTIMESTAMP images idBIGINT content_hashCHAR storage_keyVARCHAR widthINTEGER heightINTEGER dominant_colorCHAR byte_sizeINTEGER uploaded_by_idBIGINT created_atTIMESTAMP boards idBIGINT owner_idBIGINT nameVARCHAR slugVARCHAR descriptionVARCHAR is_secretBOOLEAN pin_countINTEGER follower_countINTEGER created_atTIMESTAMP board_sections idBIGINT board_idBIGINT nameVARCHAR positionSMALLINT pin_countINTEGER created_atTIMESTAMP board_collaborators board_idBIGINT user_idBIGINT roleVARCHAR statusVARCHAR invited_by_idBIGINT joined_atTIMESTAMP pins idBIGINT image_idBIGINT board_idBIGINT section_idBIGINT saver_idBIGINT source_pin_idBIGINT root_pin_idBIGINT titleVARCHAR descriptionVARCHAR destination_urlVARCHAR save_countINTEGER created_atTIMESTAMP pin_reactions pin_idBIGINT user_idBIGINT reactionVARCHAR created_atTIMESTAMP pin_comments idBIGINT pin_idBIGINT author_idBIGINT parent_comment_idBIGINT bodyVARCHAR created_atTIMESTAMP user_follows follower_idBIGINT followee_idBIGINT created_atTIMESTAMP board_follows board_idBIGINT user_idBIGINT created_atTIMESTAMP saved_searches idBIGINT user_idBIGINT queryVARCHAR filtersJSONB notify_on_newBOOLEAN last_run_atTIMESTAMP created_atTIMESTAMP

Related database schemas