Scale indexing with log volume
When a dataset's log volume grows, KalDB adds Kafka partitions and indexers for it. New logs spread across them from then on, and nothing already indexed is moved or reindexed.
When log volume grows, KalDB adds indexing capacity for the dataset that needs it. It assigns more Kafka partitions, starts an indexer for each one, and spreads new logs across them. Data that is already indexed stays where it is.
The problem
Log volume grows in steps. A large service is onboarded, a team turns on debug logging, or a bad deploy starts logging in a loop. When indexing can’t keep up, the newest logs, the ones people are searching, are the last to become searchable.
In Elasticsearch and OpenSearch, the number of primary shards is fixed when an index is created. To index faster, you either wait for the next index rollover or split and reindex, which copies data while the cluster is already under load. So teams size indexing for the largest volume they expect and pay for it all the time.
How it works
Each KalDB indexer reads exactly one Kafka partition, and every dataset has a set of partitions it writes to. Adding indexing capacity means adding partitions to the dataset and starting an indexer for each one.
- Volume grows. A dataset sends more logs than its indexers can keep up with, and logs start to wait in Kafka.
- More partitions and indexers. KalDB assigns the dataset more Kafka partitions and starts an indexer for each new one.
- The preprocessor picks up the change. It starts routing the dataset’s new logs across all of its partitions, with no restart.
- No data moves. The change applies from now on. Partition assignments are recorded with the time they take effect, so logs that were already indexed stay in the snapshots they were written to. Searches use the right partitions for each part of the time range they ask for.
Why it matters
- Fresh logs as volume grows. Indexing capacity grows with the dataset, so new logs stay searchable in near real time.
- No reindexing. Old data is never split, copied, or reindexed to add capacity.
- Scale one tenant, not the cluster. Only the dataset that grew gets more partitions and indexers. Other tenants are untouched.
- No paying for peak. Indexing is sized for the volume each dataset has now, not the largest it might ever have.
Trade-offs
- Changes apply to new data. Adding partitions speeds up indexing from now on. A backlog already waiting on the old partitions isn’t picked up by the new indexers. It drains through the existing indexers, or through recovery when an indexer restarts far behind.
- Each partition costs an indexer. More partitions means more indexers to run, so capacity is added in whole indexer steps.
- Kafka needs spare partitions. The topic must have enough partitions to assign. Plan topic size for growth.