Architecture¶
TraceLake has three processes: the ingestor, the compactor and the query gateway. An optional fourth, the tail service, serves the newest events of a dataset from memory. They share one configuration file. All durable data is in open Apache Iceberg tables in your own object storage. An Iceberg REST catalog that you operate records which files make up each table.
Open the interactive diagram for pan and zoom, search, and export to PNG or SVG.
Components¶
| Component | Runs as | Does |
|---|---|---|
| Ingestor | StatefulSet | Consumes JSON events from Kafka, maps them to columns, stages them in a local Parquet write-ahead log, uploads the files and commits them to the table. |
| Compactor | Deployment | Merges small files into large ones, builds a bloom-filter and a full-text index for each merged file, and expires old snapshots. If you turn it on, it also removes data older than retentionDays from the table. |
| Query gateway | StatefulSet | Authenticates each request, prunes the files a query cannot match, and scans the rest. Serves HTTP and, optionally, the PostgreSQL wire protocol and MCP. |
| Iceberg REST catalog | Your service, e.g. Lakekeeper | Holds the pointer to each table's current snapshot. TraceLake does not ship a catalog. |
| Object storage | Your bucket or storage account | Holds the Parquet data files, the Iceberg metadata and the index sidecars. |
| OIDC provider | Your identity provider | Issues the bearer tokens. The gateway fetches its signing keys (JWKS). |
| Hot source | Your PostgreSQL, or the TraceLake tail service (a Deployment); optional | Holds the newest events of a dataset before they are in Iceberg. The tail service reads them from Kafka and keeps them in memory only. The gateway reads the rows after a time T from it. |
Your data stays open¶
The tables are standard Iceberg tables. Trino, Spark, DuckDB or any other engine that supports the Iceberg REST catalog can read the same tables through the same catalog. The ingestor, compactor and gateway hold no data that is not also in the tables.
An engine can also write to the tables, for example a Spark or Trino backfill. Each table records how
TraceLake writes its files, so that an engine that writes to it makes similar files. At each start,
the ingestor sets these table properties from the dataset's compaction settings:
| Table property | Value |
|---|---|
write.parquet.compression-codec |
compaction.compression. Not set for lz4. |
write.parquet.compression-level |
compaction.compressionLevel. Set for zstd only. |
write.target-file-size-bytes |
compaction.targetSizeMb × 1 MiB |
commit.manifest-merge.enabled |
true |
commit.manifest.min-count-to-merge |
100 |
The ingestor writes to the catalog only when a value is different from the configuration. If you change one of these properties with an engine, the ingestor sets it back at its next start.
Do not expire snapshots with another engine
TraceLake expires snapshots and deletes unused files itself. Do not run expire_snapshots
from another engine, and do not turn on the catalog's own snapshot expiry for these tables.
Another expirer deletes files immediately, while the gateway can still read them. It also
leaves the text index and statistics files of the deleted data files in storage. On
Lakekeeper Plus, also turn off Remove Orphan Files
(LAKEKEEPER__TASK_REMOVE_ORPHANED_FILES_WORKERS=0): it deletes table metadata files sooner
than TraceLake does, and an older catalog backup can then no longer be restored. It also
examines data/ in the table location, and it does not delete the sidecars of the data files
that it deletes.
Where the files are¶
All paths are relative to storage.destinationUri. <namespace> is ingestion.namespace.
| Path | Holds |
|---|---|
<namespace>/<dataset>/ |
The table location. TraceLake creates the table here. |
<namespace>/<dataset>/data/<uuid>.parquet |
The data files that TraceLake writes. |
<namespace>/<dataset>/metadata/ |
The Iceberg metadata files. |
_metadata/<namespace>/datasets/<dataset>/puffin/<uuid>.puffin |
The bloom filters and statistics of one data file. |
_metadata/<namespace>/datasets/<dataset>/idx/<uuid>.idx |
The full-text index of one data file. |
_metadata/<namespace>/datasets/<dataset>/owner |
The cluster.id of the deployment that writes the table. |
A sidecar has the UUID of its data file in its name. The diagram shows which process writes each file. A merge does not add sidecars to the files it reads: it writes a new file, with a new UUID and its own sidecars.
- Write. The ingestor's uploader writes the data file and, if the dataset has
bloomFilterColumns, its bloom-filter sidecar. A merge writes a new data file, with a new UUID, and the sidecars that the dataset configures: the bloom filters and the distinct-value sketches forbloomFilterColumnsandndvColumns, and the full-text index fortantivy.indexingColumns. The full-text sidecar is built only at a merge, never at ingest. - Read. The gateway reads a bloom-filter sidecar whole and keeps it in memory. It reads a full-text sidecar in parts and keeps them on its local disk. See Caches.
- Delete. Orphan cleanup deletes a data file and its sidecars together, after no snapshot refers to the data file.
A data file with no sidecar is scanned, not skipped. Files that another engine wrote have no sidecars.
The catalog deletes the old metadata files: Lakekeeper keeps the current file and the 100 previous
ones. A table that TraceLake 1.0.0 created is at a location that the catalog chose, not at
<namespace>/<dataset>/. When the catalog drops a table with purge, it deletes the table location
only. It does not delete _metadata/<namespace>/datasets/<dataset>/: see
Dropping a dataset. Because the paths
contain the namespace, deployments on different namespaces can use the same destinationUri and the
same dataset names. Two deployments on the same namespace and destinationUri write the same
table, so the second one does not start: see the
runbook.
Files written before the paths contained the namespace are at <dataset>/data/. They stay
readable, with some limits: see
the runbook.