Notion workspace database schema

How a docs-and-databases workspace models its data: nested pages, a document stored as an ordered block tree, user-defined databases whose rows are pages, views with filters and sorts, inherited permissions and block-anchored comments.

Notion Workspace ER diagram

Notion workspace 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 n1 n1 n1 n1 n1 n1 users idBIGINT emailVARCHAR full_nameVARCHAR avatar_urlVARCHAR created_atTIMESTAMPTZ workspaces idBIGINT nameVARCHAR domainVARCHAR default_page_roleVARCHAR created_atTIMESTAMPTZ workspace_members workspace_idBIGINT user_idBIGINT roleVARCHAR joined_atTIMESTAMPTZ pages idBIGINT workspace_idBIGINT parent_page_idBIGINT database_idBIGINT titleVARCHAR iconVARCHAR cover_urlVARCHAR positionNUMERIC is_templateBOOLEAN created_by_idBIGINT last_edited_by_idBIGINT archived_atTIMESTAMPTZ created_atTIMESTAMPTZ updated_atTIMESTAMPTZ blocks idBIGINT page_idBIGINT parent_block_idBIGINT block_typeVARCHAR contentJSONB positionNUMERIC child_page_idBIGINT created_by_idBIGINT last_edited_by_idBIGINT archived_atTIMESTAMPTZ created_atTIMESTAMPTZ updated_atTIMESTAMPTZ databases idBIGINT page_idBIGINT title_property_idBIGINT descriptionTEXT created_atTIMESTAMPTZ database_properties idBIGINT database_idBIGINT nameVARCHAR property_typeVARCHAR configJSONB positionNUMERIC created_atTIMESTAMPTZ page_property_values page_idBIGINT property_idBIGINT valueJSONB updated_atTIMESTAMPTZ database_views idBIGINT database_idBIGINT nameVARCHAR view_kindVARCHAR group_by_property…BIGINT date_property_idBIGINT visible_property_…JSONB positionNUMERIC created_atTIMESTAMPTZ view_filters idBIGINT view_idBIGINT property_idBIGINT parent_filter_idBIGINT conjunctionVARCHAR operatorVARCHAR operandJSONB ordinalSMALLINT view_sorts view_idBIGINT property_idBIGINT directionVARCHAR ordinalSMALLINT page_permissions idBIGINT page_idBIGINT user_idBIGINT is_workspace_wideBOOLEAN roleVARCHAR public_link_tokenCHAR granted_by_idBIGINT granted_atTIMESTAMPTZ comments idBIGINT page_idBIGINT block_idBIGINT parent_comment_idBIGINT author_idBIGINT bodyJSONB anchor_textVARCHAR resolved_atTIMESTAMPTZ resolved_by_idBIGINT created_atTIMESTAMPTZ

Related database schemas