> ## Documentation Index
> Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Warehouse Native Confidence

> Warehouse Native Confidence runs on your own BigQuery, Snowflake, Redshift, or Databricks warehouse, so your data stays in your infrastructure.

Warehouse Native Confidence is optional. Every new account starts on
[Confidence Cloud](/docs/start/confidence-cloud), where Confidence creates and
operates the warehouse for you. Choose Warehouse Native when you want your data
to stay in your own warehouse, define tables with your own SQL, or analyze an
experiment that runs outside Confidence with your own assignment and fact
tables. For a side-by-side comparison, see
[Confidence Cloud](/docs/start/confidence-cloud#confidence-cloud-compared-to-your-own-warehouse).

Warehouse Native Confidence runs on top of your data warehouse, so your data
stays safe, correct, and up to date. You have full transparency into what
Confidence does with your data, and you can audit and reproduce calculations.

## Choose Your Warehouse

* [BigQuery](/docs/start/warehouse-native/bigquery)
* [Snowflake](/docs/start/warehouse-native/snowflake)
* [Redshift](/docs/start/warehouse-native/redshift)
* [Databricks](/docs/start/warehouse-native/databricks)

<Tip>
  You can run the setup with an AI assistant instead. Each setup page has a skill
  for its warehouse, for example:

  ```bash theme={null}
  npx skills add spotify/confidence-ai-plugins --skill setup-warehouse-bigquery
  ```

  The other skills are `setup-warehouse-snowflake`, `setup-warehouse-redshift`,
  and `setup-warehouse-databricks`.
</Tip>

## How Confidence Interacts With Your Data Warehouse

Depending on the functionality you want to use, Confidence needs access to read from and write to
your data warehouse.

Confidence needs write access to write:

* general events that you log using the events service
* assignments when you resolve flags
* exposure tables calculated from assignment events

Confidence needs read access to read:

* assignments to calculate exposure
* data you want to use to calculate metrics

The following figure gives a high-level overview of how the events, metrics, and flags services in
Confidence read and write to your data warehouse.
You can use only a subset of these services.
In that case, only the relevant parts of the diagram apply.

<img src="https://mintcdn.com/confidence-7c0fec1b/jMySNzOX-h8w-Z-A/images/warehouse-overview.png?fit=max&auto=format&n=jMySNzOX-h8w-Z-A&q=85&s=7904afac1eb44600f7965df23ee83ffb" alt="Overview of how Confidence connects to your data warehouse" width="3406" height="2078" data-path="images/warehouse-overview.png" />

## Queries in Your Data Warehouse

To calculate exposure and metrics, Confidence runs queries in your data warehouse.
You can read more on the [metrics page](/docs/capabilities/metrics/overview#how-confidence-computes-metrics).

### Permissions

You can grant Confidence access only to the relevant tables in your data warehouse.
You don't need to grant global access to your entire data warehouse.

### Data Cache

Confidence caches aggregated results of metrics in its database to improve performance.
The cache only includes the aggregated results of metrics, not the underlying data.
For basic metrics, this means that Confidence stores the daily count, mean and variance for each
treatment group.

## Transient Data in Confidence Flags

With Confidence Flags and the managed resolver, data temporarily passes through Confidence.
The information that Confidence persists is:

* The number of resolves and the timestamp of the last resolve.
* The number of applies and the timestamp of the last apply.
* The names of the fields available in the context. The values of the fields in the context are
  never stored.

Read more on the [data transfer page](/docs/capabilities/flags/data-transfer).
