---
title: Page database structure
related:
  - https://docs.kentico.com/13/managing-website-content/working-with-pages.md
  - https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-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 Xperience 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/13/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 does not store any [versioned data](https://docs.kentico.com/13/configuring-xperience/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/13/multilingual-websites/editing-the-content-of-multilingual-websites.md)<br>The data of [page builder widgets](https://docs.kentico.com/13/managing-website-content/adding-page-content-using-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/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md).<br>The **DocumentNodeID** column of _CMS\_Document_ records stores a reference to the related _CMS\_Tree_ record.                                                                                                                                                                                                                                                                                                                                                                                      |
| Coupled data tables | Stores the fields of individual [page types](https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-page-types.md).<br>For example, an _Article_ page type could have a coupled table named _DancingGoat\_Article_ with columns defined for article pages, such as _ArticleTitle_, _ArticleSummary_, _ArticleText_.<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>Page types without fields, such as _Folder_, do not have a coupled table.<br>Every [language version](https://docs.kentico.com/13/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/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md). |

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

> **Tip:** The **View\_CMS\_Tree\_Joined** view contains the most commonly used columns from the _CMS\_Tree_ and _CMS\_Document_ table. You can query this view to retrieve page data that is spread across these two tables.

## Page attachments and versions

| Database table         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CMS\_Attachment        | Stores files uploaded to the database as [page attachments](https://docs.kentico.com/13/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 _Content_ 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/13/configuring-xperience/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/13/page-database-structure/Database_documents.png "Database diagram of all page tables")

## Products

[Products](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/products.md) represent merchandise or services in online stores. The system associates product objects (SKUs) with pages representing product types.

The primary product data is stored in the **COM\_SKU** database table.

- Pages representing products are bound to the related SKU through the **NodeSKUID** column of the **CMS\_Tree** table.
- Most product columns are [versioned](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-and-using-page-versioning.md) and covered by [workflow](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-workflows.md) (exceptions include the product image, as well as the _Track inventory_ and _Available items_ properties).
- If a product page is available in multiple [language versions](https://docs.kentico.com/13/multilingual-websites/editing-the-content-of-multilingual-websites.md) AND covered by workflow, the versioned product properties are **NOT shared between different language versions** of a single product. Any updates of the product **Price** (or other key properties) need to be made separately for each language version.

## 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/13/managing-website-content/working-with-pages/working-with-page-relationships.md)<br>Ad-hoc relationships that represent re-use of a page's content within a _Pages_ field of another page (see [Reusing existing page content](https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-page-types/reusing-existing-page-content.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/13/page-database-structure/Database_doc_Relationships.png "Database diagram of page relationship tables")
