---
title: Page database structure
related:
  - https://docs.kentico.com/k82/managing-website-content/working-with-pages.md
  - https://docs.kentico.com/k82/developing-websites/defining-website-data-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 joined 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/k82/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/k82/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/k82/multilingual-websites/editing-the-content-of-multilingual-websites.md)<br>The content of [editable regions](https://docs.kentico.com/k82/managing-website-content/working-with-pages/editing-pages.md)<br>The data of [editor widgets](https://docs.kentico.com/k82/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/k82/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/k82/developing-websites/defining-website-data-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/k82/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/k82/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/k82/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/k82/managing-website-content/working-with-files/page-attachments.md).                                                                                                                                                                                                                                             |
| CMS\_VersionHistory    | Stores [page versions](https://docs.kentico.com/k82/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/k82/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.                                                                      |
| 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/k82/page-database-structure/Database_doc_Relationships.png "Database diagram of page relationship tables")
