Discord chat platform database schema

How a community chat platform models its data: servers with nested channels, roles carrying permission bitfields, three-state per-channel overwrites, per-server nicknames, messages and threads, reactions, attachments, invites and voice sessions.

Discord ER diagram

Discord chat platform database schema n1 n1 n1 n1 n1 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 display_nameVARCHAR emailVARCHAR avatar_urlVARCHAR is_botBOOLEAN mfa_enabledBOOLEAN created_atTIMESTAMP guilds idBIGINT nameVARCHAR owner_idBIGINT icon_urlVARCHAR system_channel_idBIGINT default_permissio…BIGINT verification_levelSMALLINT created_atTIMESTAMP channels idBIGINT guild_idBIGINT parent_idBIGINT kindVARCHAR nameVARCHAR topicVARCHAR position_indexSMALLINT is_nsfwBOOLEAN rate_limit_secondsSMALLINT bitrateINTEGER user_limitSMALLINT created_atTIMESTAMP roles idBIGINT guild_idBIGINT nameVARCHAR permissionsBIGINT color_rgbINTEGER position_indexSMALLINT is_hoistedBOOLEAN is_mentionableBOOLEAN is_managedBOOLEAN guild_members idBIGINT guild_idBIGINT user_idBIGINT nicknameVARCHAR joined_atTIMESTAMP muted_untilTIMESTAMP is_deafenedBOOLEAN boost_sinceTIMESTAMP member_roles guild_member_idBIGINT role_idBIGINT assigned_atTIMESTAMP channel_overwrites idBIGINT channel_idBIGINT role_idBIGINT user_idBIGINT allow_bitsBIGINT deny_bitsBIGINT created_atTIMESTAMP messages idBIGINT channel_idBIGINT thread_idBIGINT author_idBIGINT contentVARCHAR reply_to_message_…BIGINT mention_everyoneBOOLEAN is_pinnedBOOLEAN sent_atTIMESTAMP edited_atTIMESTAMP deleted_atTIMESTAMP threads idBIGINT parent_channel_idBIGINT starter_message_idBIGINT creator_idBIGINT nameVARCHAR is_archivedBOOLEAN auto_archive_minu…INTEGER message_countINTEGER created_atTIMESTAMP last_message_atTIMESTAMP message_reactions message_idBIGINT user_idBIGINT emojiVARCHAR reacted_atTIMESTAMP attachments idBIGINT message_idBIGINT file_urlVARCHAR filenameVARCHAR content_typeVARCHAR size_bytesBIGINT width_pxINTEGER height_pxINTEGER is_spoilerBOOLEAN invites codeVARCHAR guild_idBIGINT channel_idBIGINT inviter_idBIGINT max_usesINTEGER use_countINTEGER is_temporaryBOOLEAN created_atTIMESTAMP expires_atTIMESTAMP voice_sessions idBIGINT channel_idBIGINT user_idBIGINT joined_atTIMESTAMP left_atTIMESTAMP self_mutedBOOLEAN is_streamingBOOLEAN regionVARCHAR

Related database schemas