tile.md

November 5, 2025 · View on GitHub

Main Structure

Internally tile data is divided into “chunks.” Every tile is at least one chunk. Each tile has the following on-disk format:

FieldTypeDescription
Num chunksuint64_tNumber of chunks in the tile
Chunk 1ChunkFirst chunk in the tile
Chunk NChunkN-th chunk in the tile

Chunk Format

A chunk has the following on-disk format:

FieldTypeDescription
Original length of chunkuint32_tThe original (unfiltered) number of bytes of chunk data
Filtered chunk lengthuint32_tThe serialized (filtered) number of bytes of chunk data
Chunk metadata lengthuint32_tNumber of bytes in the chunk metadata
Chunk metadatauint8_t[]Chunk metadata bytes
Chunk filtered datauint8_t[]Filtered chunk bytes

The metadata added to a chunk depends on the sequence of filters in the pipeline used to filter the containing tile.

If a pipeline used to filter tiles is empty (contains no filters), the tile is still divided into chunks and serialized according to the above format. In this case there are no chunk metadata bytes (since there are no filters to add metadata), and the filtered bytes are the same as original bytes.

The “chunk metadata” before the actual "chunk filtered data" depend on the particular sequence of filters in the pipeline. In the simple case, each filter will simply concatenate its metadata to the chunk metadata region. Because some filters in the pipeline may wish to filter the metadata of previous filters (e.g. compression, where it is beneficial to compress previous filters’ metadata in addition to the actual chunk data), the ordering of filters also impacts the metadata that is eventually written to disk.

The “chunk filtered data” bytes contain the final bytes of the chunk after being passed through the entire pipeline. When reading tiles from disk, the filter pipeline is run in the reverse order.

Internally, any filter in a filter pipeline produces two arrays of data as output: a metadata byte array and a filtered data byte array. Additionally, these output byte arrays can be arbitrarily separated into “parts” by any filter. Typically, when a next filter receives the output of the previous filter as its input, it will filter each “part” independently.

New in version 11 Cells of arrays are not split across chunks within a tile.

Byteshuffle Filter

The byteshuffle filter does not filter input metadata, and the output data is guaranteed to be the same length as the input data.

The byteshuffle filter produces output metadata in the format:

FieldTypeDescription
Number of partsuint32_tNumber of data parts
Length of part 1uint32_tNumber of bytes in data part 1
Length of part Nuint32_tNumber of bytes in data part N

The byteshuffle filter produces output data in the format:

FieldTypeDescription
Part 1uint8_t[]Byteshuffled data part 1
Part Nuint8_t[]Byteshuffled data part N

Bitshuffle Filter

The bitshuffle filter does not filter input metadata. It produces output metadata in the format:

FieldTypeDescription
Number of partsuint32_tNumber of data parts
Length of part 1uint32_tNumber of bytes in data part 1
Length of part Nuint32_tNumber of bytes in data part N

The bitshuffle filter produces output data in the format:

FieldTypeDescription
Part 1uint8_t[]Bitshuffled data part 1
Part Nuint8_t[]Bitshuffled data part N

Parts larger than 8192 bytes are shuffled in chunks of 8192 bytes.

Bit Width Reduction Filter

The bit width reduction filter does not filter input metadata. It produces output metadata in the format:

FieldTypeDescription
Length of inputuint32_tOriginal input number of bytes
Number of windowsuint32_tNumber of windows in output
Window 1 metadataWindowMDMetadata for window 1
Window N metadataWindowMDMetadata for window N

The type WindowMD has the format:

FieldTypeDescription
Window value offsetTOffset applied to values in the output window, where T is the original datatype of the tile values.
Bit width of reduced typeuint8_tNumber of bits in the new datatype of the values in the output window. Can be 8, 16, 32 or 64.
Window lengthuint32_tNumber of bytes in output window data.

The bit width reduction filter produces output data in the format:

FieldTypeDescription
Window 1uint8_t[]Window 1 data (possibly-reduced width elements)
Window Nuint8_t[]Window N data (possibly-reduced width elements)

Note

Prior to version 20, the bit width reduction filter had no effect on date and time types.

Positive Delta Encoding Filter

The positive-delta encoding filter does not filter input metadata. It produces output metadata in the format:

FieldTypeDescription
Number of windowsuint32_tNumber of windows in output
Window 1 metadataWindowMDMetadata for window 1
Window N metadataWindowMDMetadata for window N

The type WindowMD has the format:

FieldTypeDescription
Window value delta offsetTOffset applied to values in the output window, where T is the datatype of the tile values.
Window lengthuint32_tNumber of bytes in output window data.

The positive-delta encoding filter produces output data in the format:

FieldTypeDescription
Window 1T[]Window 1 delta-encoded data
Window NT[]Window N delta-encoded data

Note

Prior to version 20, the positive delta encoding filter had no effect on date and time types.

Compression Filters

The compression filters do filter input metadata. They produce output metadata in the format:

FieldTypeDescription
Number of metadata partsuint32_tNumber of input metadata parts that were compressed
Number of data partsuint32_tNumber of input data parts that were compressed
Metadata part 1CompressedPartMDMetadata about the first metadata
Metadata part NCompressedPartMDMetadata about the nth metadata part
Data part 1CompressedPartMDMetadata about the first data part
Data part NCompressedPartMDMetadata about the nth data part

The type CompressedPartMD has the format:

FieldTypeDescription
Part original lengthuint32_tInput length of the part (before compression)
Part compressed lengthuint32_tCompressed length of the part

The compression filters then produce output data in the format:

FieldTypeDescription
Metadata part 0 compressed bytesuint8_t[]Compressed bytes of the first metadata part
Metadata part N compressed bytesuint8_t[]Compressed bytes of the nth metadata part
Data part 0 compressed bytesuint8_t[]Compressed bytes of the first data part
Data part N compressed bytesuint8_t[]Compressed bytes of the nth data part

Checksum Filters

The filter metadata for TILEDB_FILTER_CHECKSUM_{MD5,SHA256} has internal format:

FieldTypeDescription
Num metadata checksumsuint32_tNumber of checksums computed on input metadata
Num data checksumsuint32_tNumber of checksums computed on input data
Num input bytes for metadata checksum 1uint64_tNumber of bytes of metadata input to the 1st metadata checksum
Metadata checksum 1uint8_t[{16,32}] (MD5/SHA256)Checksum produced on first metadata input
Num input bytes for metadata checksum Nuint64_tNumber of bytes of metadata input to the N-th metadata checksum
Metadata checksum Nuint8_t[{16,32}] (MD5/SHA256)Checksum produced on N-th metadata input
Num input bytes for data checksum 1uint64_tNumber of bytes of data input to the 1st data checksum
Data checksum 1uint8_t[{16,32}] (MD5/SHA256)Checksum produced on first data input
Num input bytes for data checksum Nuint64_tNumber of bytes of data input to the N-th data checksum
Data checksum Nuint8_t[{16,32}] (MD5/SHA256)Checksum produced on N-th data input
Input metadatauint8_t[]Original input metadata, copied intact

Encryption Filters

If the array is encrypted, TileDB uses an extra internal filter at the end of the pipeline for AES encryption.

The encryption filter metadata have the following on-disk format:

FieldTypeDescription
Num metadata partsuint32_tNumber of encrypted metadata parts
Num data partsuint32_tNumber of encrypted data parts
AES Metadata Part 1AESPartMetadata part 1
AES Metadata Part NAESPartMetadata part N
AES Data Part 1AESPartData part 1
AES Data Part NAESPartData part N

The original metadata is not included in the metadata output.

The AESPart field has the following on-disk format:

FieldTypeDescription
Plaintext lengthuint32_tThe original unencrypted length of the part
Encrypted lengthuint32_tThe encrypted length of the part
IV Bytesuint8_t[12]AES-256-GCM IV bytes
Tag Bytesuint8_t[16]AES-256-GCM tag bytes

The data output of the encryption filter is:

FieldTypeDescription
Metadata part 1uint8_t[]The encrypted bytes of metadata part 1
Metadata part Nuint8_t[]The encrypted bytes of metadata part N
Data part 1uint8_t[]The encrypted bytes of data part 1
Metadata part Nuint8_t[]The encrypted bytes of data part N

Note that the original input metadata in not part of the output.