> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-self-hosted/concepts/metadata-database-vs-data-warehouse.md).

# Metadata Database vs. Data Warehouse

## Overview

CARTO Self-Hosted involves two distinct database systems that are often confused. This page clarifies their roles.

## The metadata database (PostgreSQL)

The **metadata database** is a PostgreSQL instance that CARTO Self-Hosted uses internally to store platform state: maps, workflows, connections, users, and organization settings. You provision and manage this database as part of your CARTO infrastructure.

* **Managed by:** You (customer)
* **Technology:** PostgreSQL
* **Contains:** Platform metadata (not your spatial data)
* **Size:** Typically small — scales with the number of CARTO users and maps

## The data warehouse

The **data warehouse** is the external database where your **spatial data** lives. CARTO connects to it to run analyses, visualize data, and power maps. CARTO does not manage this database; it connects to it using credentials you provide.

* **Managed by:** You (customer) or your cloud provider
* **Technology:** BigQuery, Snowflake, Redshift, PostgreSQL, Databricks, etc.
* **Contains:** Your spatial datasets and analysis results
* **Size:** Scales with your data volume

## Side-by-side comparison

|                       | Metadata Database                 | Data Warehouse                        |
| --------------------- | --------------------------------- | ------------------------------------- |
| **Purpose**           | Store CARTO platform state        | Store and query your spatial data     |
| **Technology**        | PostgreSQL                        | BigQuery, Snowflake, Redshift, etc.   |
| **Managed by**        | Customer (as part of CARTO infra) | Customer (external system)            |
| **Required**          | Yes, always                       | Yes, at least one connection required |
| **CARTO accesses it** | Internally, always                | Via connections you configure         |
| **Size**              | Small (metadata only)             | Large (your data)                     |

## How they relate at runtime

```mermaid
flowchart LR
  subgraph "Your infrastructure"
    MD[("Metadata Database\nPostgreSQL")]
    DW[("Data Warehouse\nBigQuery / Snowflake / etc.")]
  end
  subgraph "CARTO Self-Hosted"
    SVC["CARTO Services"]
  end
  U["Users / API clients"] --> SVC
  SVC -->|"platform state\n(maps, users, config)"| MD
  SVC -->|"spatial data queries\n(tiles, analyses)"| DW
```

The metadata database is always accessed by CARTO internally. The data warehouse is accessed on behalf of users when they open maps, run workflows, or execute queries.

## Next steps

* [How CARTO uses the Metadata Database](/carto-self-hosted/concepts/metadata-database.md) — what is stored and why
* [Metadata Database prerequisites](/carto-self-hosted/planning/prerequisites/metadata-database.md) — supported versions, managed service options, and checklist
* [Plan Your Deployment](/carto-self-hosted/planning.md) — prerequisites, sizing, and deployment method selection


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.carto.com/carto-self-hosted/concepts/metadata-database-vs-data-warehouse.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
