# Preliminary setup

## Synchronization strategies

When connecting a data warehouse to mediarithmics, you will need to configure a service account with specific rights on the data you want to expose. The service account will need to at least have read access on the data.

#### Working schema

If you want to use synchronization strategies that can handle updates and deletes on existing data, you will need to create a **working schema**. On this working schema, the service account should have editing rights : this will be used to create temporary tables and track changes on your tables. See [Access management](#access-management) for more details on how to configure service accounts, and how to create a working schema.

#### Available strategies

* **Profile data**
  * *Timestamp based* : all updates in the source table (insert, update, delete) are impacted in mediarithmics. This requires a timestamp column tracking the last update of each line of the table.
  * *Hash table* : all updates in the source table (insert, update, delete) are impacted in mediarithmics. A temporary table is created based on a hash of columns of the source table.&#x20;
  * *Full import* : every synchronization will import the full table. It does not handle deletes or updates, this is a append-only strategy.
* **Event data**&#x20;
  * *Timestamp based* : import all events that occurred since the last import. This requires a timestamp column tracking when each event of the table has occurred. It does not handle deletes or updates, this is a append-only strategy.

{% hint style="info" %}
At the time of the synchronization, if the source table for events contains data that will be impacted by active [cleaning rules](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/cleaning-rules) on events for the datamart, then these events will not be imported.&#x20;
{% endhint %}

#### Summary

Without a working schema only append-only strategies are available : timestamp based for event data, and full import for profile data.

<table><thead><tr><th width="347.33331298828125">Strategy</th><th width="474.666748046875">Needs a working schema</th></tr></thead><tbody><tr><td><strong>Timestamp based</strong></td><td>Events : No<br>Profile : Yes</td></tr><tr><td><strong>Full import</strong></td><td>No</td></tr><tr><td><strong>Hash table</strong></td><td>Yes</td></tr></tbody></table>

## Access management&#x20;

To set up a connection to a data warehouse you will need to follow specific steps based on your provider :

* [bigquery](https://developer.mediarithmics.io/data-streams/data-warehouse/preliminary-setup/bigquery "mention")
* [snowflake](https://developer.mediarithmics.io/data-streams/data-warehouse/preliminary-setup/snowflake "mention")
