---
title: Page database structure
related:
  - https://docs.kentico.com/k10/managing-website-content/working-with-pages.md
  - https://docs.kentico.com/k10/developing-websites/defining-website-content-structure/page-types.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The Kentico database stores pages (nodes in the content tree of websites) in several interconnected tables:

| Database table                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CMS\_Tree                          | Stores:<br>Data that determines the position of pages in the website content tree<br>Basic page properties that are shared between all [language versions](https://docs.kentico.com/k10/multilingual-websites/editing-the-content-of-multilingual-websites.md) of the same page<br>Contains **only one record for each page**, regardless of the number of language versions. The table doesn't store any [versioned data](https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| CMS\_Document                      | Stores:<br>Page properties that have unique values for each [language version](https://docs.kentico.com/k10/multilingual-websites/editing-the-content-of-multilingual-websites.md)<br>The content of [editable regions](https://docs.kentico.com/k10/managing-website-content/working-with-pages/editing-pages.md)<br>The data of [editor widgets](https://docs.kentico.com/k10/managing-website-content/adding-page-content-through-widgets.md)<br>May contain **multiple records per page**, one for each language version. Some of the page columns are [versioned](https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md).                                                                                                                                                                                                                                                                                                                                    |
| Coupled data tables<br>(CONTENT\_) | Stores the fields of individual [page types](https://docs.kentico.com/k10/developing-websites/defining-website-content-structure/page-types.md).<br>For example, the _News_ page type has the **CONTENT\_News** coupled table with the columns defined for news pages, such as _NewsTitle_, _NewsSummary_, _NewsText_.<br>Records in the coupled data tables are bound to pages through the **DocumentForeignKeyValue** column of the **CMS\_Document** table.<br>The page type of tree nodes is determined by the **NodeClassID** column in the **CMS\_Tree** table.<br>Container page types, such as _Folder_, do not have a coupled table.<br>Every [language version](https://docs.kentico.com/k10/multilingual-websites/editing-the-content-of-multilingual-websites.md) of a page has its own record in the corresponding coupled data table.<br>All columns in coupled data tables are [versioned](https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md). |

![The relationships between page database tables](https://docs.kentico.com/docsassets/k10/page-database-structure/Document_tables.png "The relationships between page database tables")

## Page attachments and versions

| Database table         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CMS\_Attachment        | Stores files uploaded to the database as [page attachments](https://docs.kentico.com/k10/managing-website-content/working-with-files/page-attachments.md).<br>Includes all types of page attachments:<br>Unsorted attachments added on the _Properties -> Attachments_ tab in the _Pages_ application. Such attachments are linked to the related page by storing its identifier (_AttachmentDocumentID_ column).<br>Attachments uploaded through specific page fields (of either the _File_ or _Attachments_ data type) on the _Form_ tab in the _Pages_ application. Such fields are represented by columns in the given page type's coupled data table.<br>Page type fields of the _File_ data type store a GUID value, which identifies the corresponding attachment in the _CMS\_Attachment_ table.<br>For fields of the _Attachments_ data type, the value in the database is always empty. Instead, the given records in the _CMS\_Attachment_ table store an identifier of the related page (_AttachmentDocumentID_ column) and a GUID value that identifies the specific field in the page type's form definition (_AttachmentGroupGUID_ column). |
| CMS\_VersionHistory    | Stores [page versions](https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md), including older versions and versions that are being edited. When a version is published, the system updates the corresponding records in the **CMS\_Tree** and **CMS\_Document** tables using the data of the version record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| CMS\_AttachmentHistory | Stores attachments of page versions. The main purpose of this table is to avoid redundancy for page versions that use the same attachments.<br>When a page version is published, the system updates the records in the **CMS\_Attachment** table using the data of the version record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| CMS\_VersionAttachment | Stores relationships between page versions and their page attachments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

![Database diagram of all page tables](https://docs.kentico.com/docsassets/k10/page-database-structure/Database_documents.png "Database diagram of all page tables")

## Page relationships

| Database table            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CMS\_Relationship         | Stores records representing relationships between two pages. Used for both:<br>[Standard named relationships](https://docs.kentico.com/k10/developing-websites/loading-and-displaying-data-on-websites/displaying-data-advanced-scenarios/displaying-related-pages-using-named-relationships.md)<br>Ad-hoc relationships that represent re-use of a page's content within a _Pages_ field of another page (see [Advanced content modeling](https://docs.kentico.com/k10/developing-websites/defining-website-content-structure/page-types/advanced-content-modeling.md)) |
| CMS\_RelationshipName     | Stores the relationship names (types) defined in the system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| CMS\_RelationshipNameSite | Binding table that connects relationship names to websites. Each entry indicates that a relationship can be used on a given site.                                                                                                                                                                                                                                                                                                                                                                                                                                        |

![Database diagram of page relationship tables](https://docs.kentico.com/docsassets/k10/page-database-structure/Database_doc_Relationships.png "Database diagram of page relationship tables")
