1. Structure
  2. Arrays
  3. Foundation
  4. Key Concepts
  5. Compute
  6. Time Traveling
  • Home
  • What is TileDB?
  • Get Started
  • Explore Content
  • Accounts
    • Individual Accounts
      • Apply for the Free Tier
      • Profile
        • Overview
        • Cloud Credentials
        • Storage Paths
        • REST API Tokens
        • Credits
    • Organization Admins
      • Create an Organization
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
    • Organization Members
      • Organization Invitations
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
  • Catalog
    • Introduction
    • Data
      • Arrays
      • Tables
      • Single-Cell (SOMA)
      • Genomics (VCF)
      • Biomedical Imaging
      • Vector Search
      • Files
    • Code
      • Notebooks
      • Dashboards
      • User-Defined Functions
      • Task Graphs
      • ML Models
    • Groups
    • Marketplace
    • Search
  • Collaborate
    • Introduction
    • Organizations
    • Access Control
      • Introduction
      • Share Assets
      • Asset Permissions
      • Public Assets
    • Logging
    • Marketplace
  • Analyze
    • Introduction
    • Slice Data
    • Multi-Region Redirection
    • Notebooks
      • Launch a Notebook
      • Usage
      • Widgets
      • Notebook Image Dependencies
    • Dashboards
      • Dashboards
      • Streamlit
    • Preview
    • User-Defined Functions
    • Task Graphs
    • Serverless SQL
    • Monitor
      • Task Log
      • Task Graph Log
  • Scale
    • Introduction
    • Task Graphs
    • API Usage
  • Structure
    • Why Structure Is Important
    • Arrays
      • Introduction
      • Quickstart
      • Foundation
        • Array Data Model
        • Key Concepts
          • Storage
            • Arrays
            • Dimensions
            • Attributes
            • Cells
            • Domain
            • Tiles
            • Data Layout
            • Compression
            • Encryption
            • Tile Filters
            • Array Schema
            • Schema Evolution
            • Fragments
            • Fragment Metadata
            • Commits
            • Indexing
            • Array Metadata
            • Datetimes
            • Groups
            • Object Stores
          • Compute
            • Writes
            • Deletions
            • Consolidation
            • Vacuuming
            • Time Traveling
            • Reads
            • Query Conditions
            • Aggregates
            • User-Defined Functions
            • Distributed Compute
            • Concurrency
            • Parallelism
        • Storage Format Spec
      • Tutorials
        • Basics
          • Basic Dense Array
          • Basic Sparse Array
          • Array Metadata
          • Compression
          • Encryption
          • Data Layout
          • Tile Filters
          • Datetimes
          • Multiple Attributes
          • Variable-Length Attributes
          • String Dimensions
          • Nullable Attributes
          • Multi-Range Reads
          • Query Conditions
          • Aggregates
          • Deletions
          • Catching Errors
          • Configuration
          • Basic S3 Example
          • Basic TileDB Cloud
          • fromDataFrame
          • Palmer Penguins
        • Advanced
          • Schema Evolution
          • Advanced Writes
            • Write at a Timestamp
            • Get Fragment Info
            • Consolidation
              • Fragments
              • Fragment List
              • Consolidation Plan
              • Commits
              • Fragment Metadata
              • Array Metadata
            • Vacuuming
              • Fragments
              • Commits
              • Fragment Metadata
              • Array Metadata
          • Advanced Reads
            • Get Fragment Info
            • Time Traveling
              • Introduction
              • Fragments
              • Array Metadata
              • Schema Evolution
          • Array Upgrade
          • Backends
            • Amazon S3
            • Azure Blob Storage
            • Google Cloud Storage
            • MinIO
            • Lustre
          • Virtual Filesystem
          • User-Defined Functions
          • Distributed Compute
          • Result Estimation
          • Incomplete Queries
        • Management
          • Array Schema
          • Groups
          • Object Management
        • Performance
          • Summary of Factors
          • Dense vs. Sparse
          • Dimensions vs. Attributes
          • Compression
          • Tiling and Data Layout
          • Tuning Writes
          • Tuning Reads
      • API Reference
    • Tables
      • Introduction
      • Quickstart
      • Foundation
        • Data Model
        • Key Concepts
          • Indexes
          • Columnar Storage
          • Compression
          • Data Manipulation
          • Optimize Tables
          • ACID
          • Serverless SQL
          • SQL Connectors
          • Dataframes
          • CSV Ingestion
      • Tutorials
        • Basics
          • Ingestion with SQL
          • CSV Ingestion
          • Basic S3 Example
          • Running Locally
        • Advanced
          • Scalable Ingestion
          • Scalable Queries
      • API Reference
    • AI & ML
      • Vector Search
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Vector Search
            • Vector Databases
            • Algorithms
            • Distance Metrics
            • Updates
            • Deployment Methods
            • Architecture
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Ingestion & Querying
            • Updates
            • Deletions
            • Basic S3 Example
            • Running Locally
          • Advanced
            • Versioning
            • Time Traveling
            • Consolidation
            • Distributed Compute
            • RAG LLM
            • LLM Memory
            • File Search
            • Image Search
            • Protein Search
          • Performance
        • API Reference
      • ML Models
        • Introduction
        • Quickstart
        • Foundation
          • Basics
          • Storage
          • Cloud Execution
          • Why TileDB for Machine Learning
        • Tutorials
          • Ingestion
            • Data Ingestion
              • Dense Datasets
              • Sparse Datasets
            • ML Model Ingestion
          • Management
            • Array Schema
            • Machine Learning: Groups
            • Time Traveling
    • Life Sciences
      • Single-cell
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Data Structures
            • Use of Apache Arrow
            • Join IDs
            • State Management
            • TileDB Cloud URIs
          • SOMA API Specification
        • Tutorials
          • Data Ingestion
          • Bulk Ingestion Tutorial
          • Data Access
          • Distributed Compute
          • Basic S3 Example
          • Multi-Experiment Queries
          • Appending Data to a SOMA Experiment
          • Add New Measurements
          • SQL Queries
          • Running Locally
          • Shapes in TileDB-SOMA
          • Drug Discovery App
        • Spatial
          • Introduction
          • Foundation
            • Spatial Data Model
            • Data Structures
          • Tutorials
            • Spatial Data Ingestion
            • Access Spatial Data
            • Manage Coordinate Spaces
        • API Reference
      • Population Genomics
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • The N+1 Problem
            • Architecture
            • Arrays
            • Ingestion
            • Reads
            • Variant Statistics
            • Annotations
            • User-Defined Functions
            • Tables and SQL
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Basic Ingestion
            • Basic Queries
            • Export to VCF
            • Add New Samples
            • Deleting Samples
            • Basic S3 Example
            • Basic TileDB Cloud
          • Advanced
            • Scalable Ingestion
            • Scalable Queries
            • Query Transforms
            • Handling Large Queries
            • Annotations
              • Finding Annotations
              • Embedded Annotations
              • External Annotations
              • Annotation VCFs
              • Ingesting Annotations
            • Variant Statistics
            • Tables and SQL
            • User-Defined Functions
            • Sample Metadata
            • Split VCF
          • Performance
        • API Reference
          • Command Line Interface
          • Python API
          • Cloud API
      • Biomedical Imaging
        • Introduction
        • Foundation
          • Data Model
          • Key Concepts
            • Arrays
            • Ingestion
            • Reads
            • User Defined Functions
          • Storage Format Spec
        • Quickstart
        • Tutorials
          • Basics
            • Ingestion
            • Read
              • OpenSlide
              • TileDB-Py
          • Advanced
            • Batched Ingestion
            • Chunked Ingestion
            • Machine Learning
              • PyTorch
            • Napari
    • Files
  • API Reference
  • Self-Hosting
    • Installation
    • Upgrades
    • Administrative Tasks
    • Image Customization
      • Customize User-Defined Function Images
      • AWS ECR Container Registry
      • Customize Jupyter Notebook Images
    • Single Sign-On
      • Configure Single Sign-On
      • OpenID Connect
      • Okta SCIM
      • Microsoft Entra
  • Glossary

On this page

  • Time traveling in dense arrays
  • Time traveling in sparse arrays
  • Time traveling in array and group metadata
  • Time traveling in schema evolution
  1. Structure
  2. Arrays
  3. Foundation
  4. Key Concepts
  5. Compute
  6. Time Traveling

Arrays: Time Traveling

arrays
foundation
time traveling
Time traveling is a powerful tool in TileDB allowing you to view and compare versions of your array at different points in time.
Note

It is strongly recommended to read the following sections before you learn about time traveling.

  • Key Concepts: Fragments
  • Key Concepts: Commits
  • Key Concepts: Fragment Metadata
  • Key Concepts: Schema Evolution
  • Key Concepts: Array metadata
  • Key Concepts: Deletions
  • Key Concepts: Consolidation
  • Key Concepts: Vacuuming

Writing to TileDB arrays produces a number of timestamped fragments, deleting from TileDB produces timestamped delete commits, and evolving the array schema produces timestamped schema files. These allow TileDB to support reading an array at an arbitrary point in time, by providing a timestamp range upon opening the array for reading. This is called time traveling, and applies to dense and sparse arrays, array and group metadata, as well as schema evolution. Time traveling can be affected by consolidation and vacuuming. The following subsections describe time traveling for various scenarios.

Time traveling in dense arrays

The figure below shows an example of a dense array with 3 fragments, along with the results of a subarray depending on the timestamp with which the array gets opened.

An illustration of various dense array fragments in a 2-dimensional dense array. The illustration shows how the array values change over time. An illustration of various dense array fragments in a 2-dimensional dense array. The illustration shows how the array values change over time.

Time traveling in dense arrays works as follows:

  • If no consolidated fragments exist (that is, the array has only fragments and commits that carry a unary timestamp range in their name), given a time range upon opening the array, TileDB will consider only the fragments and commits whose timestamps fall inside the time range.
  • If one or more consolidated fragments exist (in which case the time range in their name isn’t unary), two distinct cases exist:
    • If the original fragments that took part in consolidation haven’t been vacuumed yet, TileDB will consider the finest timestamp granularity to choose the fragments in the read query, which leads to the highest fidelity of results when time traveling. For example, if the array has three fragments with timestamps 1, 2, and 3, which were consolidated into a fragment with time range 1-3, then four fragments will exist given that no vacuuming took place. If the time range in the query is 1-2, TileDB will consider the original fragments with timestamps 1 and 2, instead of the consolidated fragment 1-3.
    • If the original fragments are vacuumed, TileDB will consider a consolidated fragment only if its time range falls completely within the query time range. In the above example, if you run vacuuming, then fragments with timestamps 1, 2, and 3 will be deleted, and only 1-3 will remain. If the time range in the query is 1-2, TileDB will skip completely the consolidated fragment with timestamp range 1-3 and no results will be produced (i.e., the fidelity is lower in this case).

Time traveling in sparse arrays

The figure below shows an example of a sparse array with 3 fragments, along with the results of a subarray depending on the timestamp with which the array gets opened.

An illustration of various sparse array fragments in a 2-dimensional sparse array. The illustration shows how the array values change over time. An illustration of various sparse array fragments in a 2-dimensional sparse array. The illustration shows how the array values change over time.

Time traveling in sparse arrays works as follows:

  • If no consolidated fragments exist (that is, the array has only fragments and commits that carry a unary timestamp range in their name), given a time range upon opening the array, TileDB will consider only the fragments and commits whose timestamps fall inside the time range. The same holds true for delete commits as well.
  • If one or more consolidated fragments exist (in which case the time range in their name isn’t unary), then sparse arrays handle them as follows: A consolidated fragment in sparse arrays include two extra system attributes; the first records the creation time of a non-empty cell, and the second the time it was potentially deleted. Given a time range in the query, TileDB considers all fragments whose timestamp range overlaps even partially with it. Then it performs further filtering as it processes the read queries by using the extra two timestamp attributes, in order to identify which non-empty cells fall within the time range of the query.

Observe that sparse arrays offer higher fidelity than dense arrays when traveling and in the presence of consolidation and vacuuming.

Time traveling in array and group metadata

The array and group metadata files are all timestamped and, hence, TileDB can quickly identify which metadata to load upon reading. The metadata file consolidation works like fragment consolidation. That is, if the array has consolidated fragment metadata but you haven’t run vacuuming yet, TileDB loads the higher fidelity data. Otherwise, TileDB loads only the consolidated metadata files. In the latter case, fidelity might be lower, because TileDB purges any deleted array and group metadata upon consolidation and, thus, you won’t be able to time travel in case you vacuumed the original metadata files that have the deletions.

Time traveling in schema evolution

Since all array schemas generated by schema evolution are timestamped, TileDB can easily identify which array schema is the latest within the provided time range in the read query, and uses it to load the appropriate array information to process the query.

Vacuuming
Reads