# Time Travel

Time Travel is a powerful feature in Lakehouse Manager that enables you to **view, explore, and restore previous versions of your tables**. This capability provides complete recovery options for your data, allowing you to track changes over time and restore to any previous state when needed.

![Time Travel Overview](picts/time-travel/time-travel-overview.png)

With Time Travel, every modification to a table such as data insertion, deletion, or other changes are automatically captured as a snapshot. These snapshots form a comprehensive version history that you can navigate, inspect, and use to revert your table to any previous point in time. This functionality is essential for data governance, debugging, and recovery from accidental changes.

> Time Travel operates automatically in the background. Every change to your table creates a new snapshot without requiring any manual intervention or configuration.

* [Understanding snapshots](#understanding-snapshots)
  * [What is a snapshot?](#what-is-a-snapshot)
  * [How snapshots are created](#how-snapshots-are-created)
  * [Snapshot statuses](#snapshot-statuses)
* [Accessing the Time Travel interface](#accessing-the-time-travel-interface)
* [The Time Travel interface](#the-time-travel-interface)
  * [Changes history visualizer](#changes-history-visualizer)
  * [Snapshots list](#snapshots-list)
* [Working with snapshots](#working-with-snapshots)
  * [Filtering and searching snapshots](#filtering-and-searching-snapshots)
  * [Exploring a snapshot](#exploring-a-snapshot)
  * [Reverting to a previous snapshot](#reverting-to-a-previous-snapshot)
* [Managing snapshot retention](#managing-snapshot-retention)
  * [Configuring retention periods](#configuring-retention-periods)

---
## Understanding snapshots

### What is a snapshot?

A snapshot is an immutable point-in-time representation of your table's state, capturing both the data and schema as they existed at a specific moment. Each snapshot is identified by a unique snapshot ID and includes metadata about when it was created, what changes were made, and its relationship to other snapshots in the version history.

**Snapshot retention:**
- Default retention: **14 days**
- Configurable range: **7 to 28 days**
- Can be set at dataset level or overridden per table
- After expiration, snapshots are automatically deleted

?> **Pro tip:** Choose your retention period based on your data change frequency and recovery requirements. Tables that undergo frequent changes or contain critical business data may benefit from longer retention periods.💡

### How snapshots are created

Snapshots are created automatically whenever you modify your table through operations such as data insertions, updates, deletions, or schema modifications. The platform captures the table's state and creates a new snapshot representing the post-change state.

Each snapshot maintains a parent-child relationship with its predecessor, creating a linked history that shows how the table evolved over time. Snapshots are lightweight and efficient—the storage system stores only the differences (deltas) between versions rather than complete copies.

### Snapshot statuses

Snapshots can have the following statuses:

- **Current**: The most recent version of the table representing its current state *(displayed in <span style="color: #0089c0;">●</span> blue)*
- **Parent**: The immediate predecessor of the current version *(displayed in <span style="color: #00c4f0;">●</span> light blue)*
- **Rollbacked**: A snapshot that was previously current but has been reverted from *(displayed in <span style="color: #b2beca;">●</span> gray)*

---
## Accessing the Time Travel interface

To access Time Travel for a specific table:

1. Navigate to **Lakehouse Manager** from the main navigation menu
2. Select **Tables** from the left sidebar
3. Click on the table you want to view
4. Click on the **Time Travel** tab

![Accessing Time Travel](picts/time-travel/time-travel-access.png)

---
## The Time Travel interface

The Time Travel interface is designed to provide both a high-level overview and detailed information about your table's version history. The interface is divided into two complementary sections that work together to help you understand and manage snapshots effectively.

![Time Travel Interface](picts/time-travel/time-travel-interface.png)

### **Changes history visualizer**

The Changes History Visualizer is a graphical timeline that provides an at-a-glance view of your table's evolution over time. This visual representation helps you quickly understand the pattern of changes, identify important versions, and see the relationships between different snapshots.

![Changes History Graph](picts/time-travel/time-travel-graph.png)

The visualizer displays snapshots as nodes on a timeline, with each node representing a specific version of your table. The nodes are connected by lines that show the parent-child relationships between snapshots, illustrating how changes flow from one version to the next. This linear representation makes it easy to trace the history of your table chronologically.

When operations such as reverts occur, the visualizer shows branching in the timeline. A revert creates a new current version that branches from an older snapshot, while the intermediate versions remain in the history. This branching visualization helps you understand the non-linear aspects of your version history and see how reverts affect the overall structure.

#### Graph controls

The visualizer provides several control buttons to help you navigate and view your version history:

- **Zoom in**: Enlarge the graph to see more detail
- **Zoom out**: Reduce the graph size to see more snapshots at once
- **Fit view**: Automatically adjusts the zoom level to fit the entire graph in the viewport, providing a complete overview of your version history
- **Center on current node**: Instantly jumps to and centers the view on the current (most recent) snapshot

These controls are especially useful when working with tables that have extensive version histories spanning many snapshots.

#### Interactive tooltips

The visualizer is fully interactive. Hovering over any node displays a tooltip with:

![Changes History Graph](picts/time-travel/time-travel-graph-node.png)

- **Version status**: Current, Parent, or Rollbacked (see [Snapshot statuses](#snapshot-statuses))
- **Snapshot ID**: The unique identifier for this version
- **Snapshot timestamp**: When this snapshot was created
- **Nature of change**: Description of what changed (e.g., "Data inserted", "Data deleted", "Data updated")

Click on any node to copy its snapshot ID to your clipboard.

### **Snapshots list**

The Snapshots List provides a detailed, tabular view of all snapshots for the table, ordered from newest to oldest. This list complements the visual timeline by offering comprehensive information and direct access to actions for each snapshot.

![Snapshots List](picts/time-travel/time-travel-list.png)

The list is paginated to handle tables with extensive version histories, ensuring the interface remains responsive even when dealing with hundreds of snapshots. You can navigate through pages to explore the complete history of your table.

Each row in the list represents a single snapshot and contains the following information:

1. **Version Status:** Indicates the snapshot's current state (see [Snapshot statuses](#snapshot-statuses))

2. **Snapshot ID:** The unique identifier for this snapshot, used in queries, API calls, or support communications

3. **Date of Snapshot:** When this snapshot was created, displayed in your local timezone

4. **Changes from Parent Version:** Description of what changed in this snapshot. Common change types include:
    - **Data inserted**: New rows were added to the table
    - **Data deleted**: Existing rows were removed from the table
    - **Data updated**: Existing rows were modified
    - **Data replaced**: Existing data was replaced
    - **Data rollbacked**: Rollback operation was performed

5. **Actions:**
    - **🔍 Explore**: Opens the snapshot in the Explorer to view its data
    - **↻ Rollback**: Restores the table to this snapshot's state

These actions are described in detail in the [Working with snapshots](#working-with-snapshots) section.

---
## Working with snapshots

### **Filtering and searching snapshots**

When working with tables that have extensive version histories, the Time Travel interface provides several tools to help you locate specific versions.

![Snapshot Filters](picts/time-travel/time-travel-filters-data.png) 
![Snapshot Filters](picts/time-travel/time-travel-filters-days.png)

#### Search by Snapshot ID

The search bar allows you to find a specific snapshot by entering its ID. The list automatically filters as you type.

#### Filter by Change Type

View only snapshots that correspond to specific modifications:
- **Data inserted**: Show only snapshots where data was added
- **Data deleted**: Show only snapshots where data was removed
- **Data updated**: Show only snapshots where existing data was modified
- **Data replaced**: Show only snapshots where existing data was replaced
- **Data rollbacked**: Show only snapshots where rollback operation was performed

#### Filter by Time Range

Focus on snapshots created within a specific period:
- **Last 7 days**: Shows snapshots from the past week
- **Last 14 days**: Shows snapshots from the past two weeks
- **Last 21 days**: Shows snapshots from the past three weeks
- **Last 28 days**: Shows all available snapshots (within maximum retention)

You can combine multiple filters to narrow your search further.

### **Exploring a snapshot**

The explore functionality allows you to inspect the data contained in a specific snapshot without affecting your current table. This is a read-only operation that provides visibility into historical states of your data.

![Explore Snapshot](picts/time-travel/time-travel-explore.png)

To explore a snapshot:

1. Click the magnifying glass icon (🔍) next to the snapshot you want to inspect
2. The Lakehouse Manager [Explorer](/en/product/lakehouse-manager/explorer/index.md) opens in a new tab with a pre-configured SQL query
![Explore Snapshot](picts/time-travel/time-travel-explore-2.png)
3. Click "Run" to execute the query and view the snapshot data
4. Interact with the data as needed: scroll, sort, filter, or export results

This exploration capability is particularly valuable for:
- Investigating when specific data values changed
- Verifying the state of data at a particular point in time
- Understanding the impact of past changes
- Retrieving data that was accidentally deleted or modified

?> **Pro tip:** Use the explore feature before performing a revert to verify that a snapshot contains the data you expect. This can prevent unnecessary revert operations.💡

### **Reverting to a previous snapshot**

Reverting to a previous snapshot is a powerful capability that allows you to restore your table to a prior state. This operation creates a new snapshot that is identical to the snapshot you're reverting to, making it the new current version of your table.

![rollback Snapshot](picts/time-travel/time-travel-rollback.png)

Reverting is a significant operation that affects your table's current data and schema. Because of its impact, the revert process includes mandatory confirmation steps to prevent accidental changes.

**Step 1: Initiate the revert**

Click the circular arrow icon (↻) next to the snapshot you wish to restore. This opens the revert confirmation dialog.

**Step 2: Review the confirmation dialog**

A modal dialog appears with important information about the revert operation:
![rollback Snapshot](picts/time-travel/time-travel-rollback-modal.png)

**Step 3: Confirm or cancel**

If you confirm, the system:
1. Reverts your table to the selected snapshot, making it the current version
2. Updates the Changes History Visualizer to show the branching that occurred
3. Displays a success message

#### Understanding the result

After a successful revert:
- Your table now contains the exact data and schema from the snapshot you reverted to
- A new snapshot has been created at the current time, preserving this state
- All previous snapshots remain available in the history
- You can revert to a different snapshot later if needed, including reverting forward to a more recent state

---
## Managing snapshot retention

Snapshot retention controls how long historical versions of your table remain available in the system. Proper retention management helps balance the need for historical data access with storage efficiency and cost considerations.

The current snapshot retention period for your table is always displayed in the Time Travel interface, ensuring you're aware of how long historical snapshots will remain available.

![Retention Info](picts/time-travel/time-travel-retention-info.png)

### **Configuring retention periods**

Retention can be configured at two levels:

#### Dataset-level retention (default)

All tables within a dataset inherit the dataset's retention period, set to **14 days** by default. You can modify this for an entire dataset to apply to all tables that haven't been individually configured with an override.

To configure dataset-level retention:

1. Navigate to the Datasets section in Lakehouse Manager
2. Click on the dataset to open its details page
3. Access the configuration or settings panel
4. Select your desired retention duration:
   - **7 days** (minimum)
   - **14 days** (default)
   - **21 days**
   - **28 days** (maximum)
5. The changes are automatically saved

![Retention Info](picts/time-travel/time-travel-retention-info-dataset.png)

This change applies immediately to all tables within the dataset that don't have a table-level override configured.

#### Table-level retention override

For tables that require different retention periods than their parent dataset, you can configure a table-specific override. This override takes precedence over the dataset-level setting.

To configure table-level retention:

1. Navigate to the specific table and open its details page
2. Access the configuration or settings panel
3. Enable "Override dataset retention"
4. Select the retention period (7, 14, 21, or 28 days)
5. The changes are automatically saved
6. Verify in the Time Travel tab that the override is active

![Retention Info](picts/time-travel/time-travel-retention-info-table.png)

To remove a table-level override, simply disable the override setting in the table configuration.

---
###  Need help? 🆘

> At any step, you can ask for support by reaching out to us on the Data Platform Channel within the [Discord Server](https://discord.com/channels/850031577277792286/1163465539981672559). You can also find a step by step guide towards joining our discord server in the [support](/en/support/index.md) section.