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

# Versioning

Versioning on a DirectQuery connector is less powerful than on a Datastore.

## Old versions access

All external databases do not support native versioning (i.e. time travel).\
For these databases you can only query the last snapshot of the data.\
Non-time travel databases are subject to de-synchronization issue (see heading below).

| Database                | Time travel Support                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Amazon Redshift         | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/error.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=abdfa6f78a4b1073723178c69f1fdb7f" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/error.svg" />                                     |
| ClickHouse              | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/error.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=abdfa6f78a4b1073723178c69f1fdb7f" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/error.svg" />                                     |
| Databricks              | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/check.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=b04cfab491cf27a06ebdf99cd8fe92d9" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/check.svg" /> (not on views)                      |
| Dremio                  | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/error.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=abdfa6f78a4b1073723178c69f1fdb7f" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/error.svg" />                                     |
| Google BigQuery         | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/check.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=b04cfab491cf27a06ebdf99cd8fe92d9" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/check.svg" />                                     |
| Microsoft Azure Synapse | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/error.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=abdfa6f78a4b1073723178c69f1fdb7f" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/error.svg" />                                     |
| Microsoft SQL Server    | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/error.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=abdfa6f78a4b1073723178c69f1fdb7f" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/error.svg" />                                     |
| Snowflake               | <img src="https://mintcdn.com/activeviam/C3uszhevq0AWZMaf/engine/java-sdk/6.0/assets/mdx/check.svg?fit=max&auto=format&n=C3uszhevq0AWZMaf&q=85&s=b04cfab491cf27a06ebdf99cd8fe92d9" alt="tick" width="16" height="16" data-path="engine/java-sdk/6.0/assets/mdx/check.svg" /> (not on views except dynamic table) |

## Data refresh

Unlike the datastore, external databases are not able to push data change event.\
The user must warn the DirectQuery connector that a new version of the data is available.

There is two ways to do this :

* If you know the scope of your changes you can use an [Incremental Refresh](./incremental-refresh).

* If you do not know the scope of the change, you can trigger a full refresh.

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
app.fullRefresh();
```

<Warning>
  A full refresh is a costly operation because it implies to rebuild all hierarchies and aggregate providers.
</Warning>

<Info>
  During these operations, the cube is still queryable.
</Info>

## De-synchronization issue with non-time travel databases

Atoti cube leverages database streams to maintain some versioned data structures:

* Hierarchy member tree
* Aggregate providers

Aggregate providers are used to store already computed primitive measures.\
On a non-time travel database, on data change and before the refresh of the application, aggregate providers are
not up-to-date.\
So the measures computed from the primitive measures of aggregate provider are outdated too.\
However, measures which are not computed from aggregate provider measures (i.e. computed by a database query) are
up-to-date.\
This could lead to inconsistent results if you are mixing up outdated and up-to-date measures.

For instance, let's take an initial version V1 and an update in the database changing the data to a new version
V2.\
Before triggering the refresh in Atoti application, the aggregate provider is still in state V1 but the database
connector has no more access to the V1 data.\
The connector will return the data from the current state of the database (which is V2).

```mermaid theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}

graph LR
;
    head["Primitive measure
    Retrieval V1"] -->|V1|prov["Aggregate Provider V1"]
head -->|V1|data["Database Connector V1"]
data -->|Last Snapshot|db["Un-versioned database"]

```

## Branching

DirectQuery databases does not support branching.
