Docs / Bulk-load history with offline ingestion

Bulk-load history with offline ingestion

Build KalDB index chunks in a Hadoop or Spark job, publish them to S3, and register them with the cluster manager. KalDB serves them next to live data, without touching Kafka or the indexers.

Not all data arrives as a live stream. Years of history sit in a data warehouse or HDFS, and batch pipelines already know how to process them. With offline ingestion, a batch job builds KalDB’s index chunks itself, publishes them to S3, and registers them with the cluster manager. KalDB then serves them next to live data, through the same API.

How KalDB serves data indexed offline by a batch jobA Hadoop or Spark job reads years of offline data and builds index chunks in parallel. It uploads the chunks to S3 as snapshots and registers each snapshot with the KalDB cluster manager, which records it in the metadata store and assigns it to cache nodes. Live ingest through Kafka and the indexers is never involved. Cache nodes load the new snapshots, and one search through the query layer returns offline and live data together.Offline datawarehouse · HDFSHadoop / Spark jobworkerworkerworker202120222023S3SepOct202120222023liveofflineregisterCluster managerrecords in ZooKeeper or etcd+ snapshot 2021 · Jan–Dec+ snapshot 2022 · Jan–Dec+ snapshot 2023 · Jan–DecLive ingestKafka → indexers · untouched by the backfillCache nodesSepOct202120222023QueryAgents &dashboardsBuilt in parallel on your batch cluster. No KalDB indexers involved.Snapshots land in S3 in the same format the indexers produce.The cluster manager records each snapshot: time range, size, S3 path.GET logs/_search over 2021 → today: offline and live, one answer
Backfill Building 3 years of chunks on the batch cluster. Snapshots uploaded to S3. Not searchable yet. Snapshots registered with the cluster manager. Live ingest never slowed down. 2021–2023 is searchable next to live data, through the same API.

The problem

Loading historical data into a search cluster usually means pushing it through the live ingest path. Years of logs or records go through the same bulk API, queues, and indexers as today’s traffic. The backfill takes days, competes with live ingest the whole time, and needs extra indexing capacity sized for the backfill, not for normal load.

Teams end up throttling the backfill, running it at night, or standing up a separate cluster just to load it. The batch cluster that already holds the data and could process it in hours sits on the sidelines.

How it works

KalDB stores indexed data as snapshots in S3 and tracks each one with a small metadata record. Cache nodes serve whatever snapshots are registered, regardless of what built them. That lets a batch job do the indexing. Registration goes through the cluster manager, so the batch job never writes to the metadata store directly.

  1. Build chunks offline. A Hadoop or Spark job reads the source data and builds index chunks in parallel, each covering a time range. It runs on your existing batch infrastructure.
  2. Upload to S3. The job uploads each chunk to S3 as a snapshot, in the same format KalDB’s indexers produce.
  3. Register the snapshots. The job registers each snapshot with the cluster manager: its time range, size, and location in S3. The cluster manager writes the same kind of metadata record that indexers write for live data. Kafka and the indexers are not involved.
  4. Serve. The cluster manager assigns the new snapshots to cache nodes, which load them from S3. The query layer searches them like any other data, so one search can span the offline history and today’s live logs.

Why it matters

  • Backfill years of data without slowing live ingest. The backfill never goes through Kafka or the indexers, so fresh logs stay fresh.
  • Use the batch cluster you already have. Hadoop or Spark does the heavy lifting in parallel, at batch prices, instead of extra KalDB indexers sized for a one-time load.
  • One API for old and new data. Agents and dashboards search history and live data with the same OpenSearch-compatible API, in a single query.
  • One control point. The cluster manager is the only way in, so the batch job needs no access to ZooKeeper or etcd, and offline snapshots are tracked, cached, and expired the same way as live ones.
  • Fast to load. Registering a snapshot is a small metadata write, so data is searchable as soon as cache nodes load it, not after a multi-day replay.

Trade-offs

  • The batch job owns correctness. Chunks built offline must use the dataset’s schema and the same index format as the indexers. A bad build is searchable as soon as it is registered.
  • Cache capacity still applies. Offline snapshots are served from cache nodes like any other data, so loading years of history needs cache capacity for it, or on-demand loading of older ranges.
  • Not for streaming data. Offline ingestion suits data that already exists in batch. Live data should keep flowing through Kafka and the indexers.

Coming next: dataset versioning

Offline ingestion is the base for dataset versioning, which is on the roadmap. A batch job will be able to publish a complete new version of a dataset, for example after reprocessing it with a new schema or new embeddings. Searches switch to the new version all at once, and rolling back means pointing back at the old version’s snapshots, which are still in S3.

Related