> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse/data-warehouse-sync.md).

# Data warehouse sync

Declare a warehouse in the Computing Console and pick a synchronisation strategy per table.

## Your goal

Declare your warehouse in the platform and choose, per table, a synchronisation strategy that matches how that table actually changes.

## Expected outcome

A warehouse connection that validates, and synchronisations that bring across the inserts - and the updates and deletes, if that is what you need.

## Declare the warehouse

{% stepper %}
{% step %}

### Prepare the access

Service account, permissions, and credentials file. See [Warehouse compatibilities](/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse/warehouse-compatibilities.md).
{% endstep %}

{% step %}

### Open the Data warehouse menu

In the **Computing Console**, under the **Data Store** section, open **Data warehouse**.
{% endstep %}

{% step %}

### Select the provider and fill in the properties

| Property                     | Notes                                                                                                                                                                |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**                     |                                                                                                                                                                      |
| **Description**              |                                                                                                                                                                      |
| **Location**                 | **BigQuery only.**                                                                                                                                                   |
| **Working dataset / schema** | The [working schema](/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse.md#the-decision-that-shapes-everything-else), if you created one. |
| {% endstep %}                |                                                                                                                                                                      |

{% step %}

### Upload the credentials file

Upload or drag and drop it. If the file contains the correct set of permissions, the data warehouse is created. If not, **an error is raised** - which makes this step your permission test.
{% endstep %}
{% endstepper %}

## Choose a strategy per table

The strategy decides which changes in your warehouse reach the datamart. It is a per-table decision, not a global one.

{% hint style="info" %}
This choice concerns tables the platform **reads** to feed the datamart. Where the warehouse is the source of truth for the datamart, the platform also writes into it, and the tables it maintains there are described in [Run your computation in the warehouse](/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse/run-your-computation-in-the-warehouse.md).
{% endhint %}

{% tabs %}
{% tab title="Profile data" %}

| Strategy            | What it does                                                                                                                                                      | Needs a working schema |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **Timestamp based** | All updates in the source table - insert, update, delete - are reflected in mediarithmics. Requires a **timestamp column tracking the last update of each line**. | Yes                    |
| **Hash table**      | All updates in the source table - insert, update, delete - are reflected. A temporary table is created based on a hash of columns of the source table.            | Yes                    |
| **Full import**     | Every synchronisation imports the full table. **Append-only** - it does not handle deletes or updates.                                                            | No                     |

Choosing between the two full-fidelity strategies: **timestamp based** if your table already carries a reliable last-update column, **hash table** if it does not.
{% endtab %}

{% tab title="Event data" %}

| Strategy            | What it does                                                                                                                                                                        | Needs a working schema |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **Timestamp based** | Imports all events that occurred since the last import. Requires a **timestamp column tracking when each event occurred**. **Append-only** - it does not handle deletes or updates. | No                     |

Events are naturally append-only, which is why the event strategy does not need a working schema.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
At the time of synchronisation, if the source table for events contains data that would be affected by active [cleaning rules](/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/cleaning-rules.md) on events for the datamart, **those events are not imported**.

This is usually what you want - but it means a backfill of old events will silently import fewer rows than the table contains.
{% endhint %}

## What the strategy costs you

| If you choose                | You accept                                                                                                                    |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Full import for profiles     | Deletions and corrections in your warehouse never reach the datamart.                                                         |
| Timestamp based for profiles | A dependency on the timestamp column being maintained correctly - a row updated without touching it is invisible to the sync. |
| Hash table                   | Temporary tables in your working schema, and the write access that implies.                                                   |
| Timestamp based for events   | Nothing unusual, provided event timestamps are accurate.                                                                      |

## Verify

* The warehouse is created without an error, which confirms the permissions.
* A first synchronisation imports the row count you expect - allowing for cleaning rules on events.
* A test update in the warehouse appears in the datamart, if your strategy handles updates.
* A test delete disappears from the datamart, if your strategy handles deletes.
* Collection volumes move for the collections concerned. See [Monitor collection volume](/setup-and-monitor/operate-and-monitor/monitor-collection-volume.md).

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Warehouse compatibilities</strong></td><td>Permissions and credentials per provider.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse/warehouse-compatibilities.md">Warehouse compatibilities</a></td></tr><tr><td><strong>Choose your deployment mode</strong></td><td>Whether the warehouse feeds the datamart or is its source of truth.</td><td><a href="/setup-and-monitor/plan-and-integrate/choose-your-deployment-mode.md">Choose your deployment mode</a></td></tr><tr><td><strong>Cleaning rules</strong></td><td>Why some events are skipped at import.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/cleaning-rules.md">Cleaning rules</a></td></tr><tr><td><strong>Data warehouse export</strong></td><td>Sending datamart data back to a warehouse.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/export-your-data/data-warehouse-export.md">Data warehouse export</a></td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/sync-with-your-data-warehouse/data-warehouse-sync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
