Skip to content

Repository files navigation

KalDB

CI License Documentation

KalDB is a cloud-native log search and analytics engine built for high-volume observability workloads. It combines OpenSearch-compatible APIs with a disaggregated storage architecture: Kafka for durable ingest, Lucene for indexing, and S3 for indexed storage.

Quick StartArchitectureDocsTalksContributing

Star it!

KalDB builds on the Astra codebase originally open-sourced by Slack and reflects production learnings from large-scale deployments at Slack and Airbnb. The project is in transition, and parts of the codebase, APIs, and docs still use the original Astra name.

Why KalDB

  • Built for log-heavy workloads with spiky ingest patterns and long retention requirements.
  • OpenSearch-compatible ingest and query APIs reduce migration work for existing pipelines and dashboards.
  • OpenSearch analytics support covers all ClickBench queries, including multi_terms aggregations, sibling aggregations, sorts with filters, and bucket-level filtering and sorting.
  • Decoupled compute and storage lets you scale indexing and querying separately.
  • Native support for logs, traces, and audit-style event data.
  • Designed to work well with Grafana, Zipkin-compatible trace tooling, and cloud object storage.

Why It Exists

KalDB was created to solve practical problems that show up as log search scales. These include ingest delays during traffic spikes, schema conflicts from fast-moving services, and operational complexity from running many large search clusters. The architecture and public talks around KalDB focus on a simple idea: keep the search experience fast, but move durability and long-term storage onto systems that scale more naturally for cloud-native environments.

Architecture Overview

KalDB is a Lucene-based system inspired by aggregator/leaf/tailer-style architectures. Kafka handles durable ingest, S3 stores indexed data, and stateless indexers can be scaled independently to keep fresh data searchable during spikes.

flowchart TD
    producers[Log shippers / bulk ingest] --> preprocessor[Preprocessor]
    grafana[Grafana / clients] --> query[Query]

    preprocessor --> kafka[(Kafka)]
    kafka --> indexers[Indexers]
    kafka --> recovery[Recovery]

    indexers --> s3[(S3 / object storage)]
    recovery --> s3

    query --> indexers
    query --> cache[Cache]
    cache <--> s3

    manager[Manager] <--> zk[(ZooKeeper)]
    manager <--> s3
Loading

Core properties of the design:

  • Fresh-data ingest is prioritized during peak load.
  • Indexer nodes are stateless, which makes horizontal scaling straightforward.
  • Storage and query paths are separated so long retention does not force expensive hot storage everywhere.
  • Existing OpenSearch-oriented tooling can often be reused instead of rewritten.

Quick Start

If you want the shortest path to a local cluster, use the helper script:

./quick_start.sh --clean

Local endpoints:

  • Query API: http://localhost:8081
  • Admin UI: http://localhost:8083/admin/
  • Manager API: http://localhost:8083
  • Preprocessor ingest API: http://localhost:8086
  • Grafana: http://localhost:3000/explore

For the manual curl workflow, API examples, and the per-service setup details, see Getting-started.md.

What You Can Build With It

Log search with Lucene-style queries

KalDB supports Lucene query syntax for field filters, wildcards, boolean queries, ranges, and optional full-text search. See Logs.md for examples and Grafana integration details.

Trace search with a Zipkin-compatible API

KalDB can store and serve traces when the required span fields are indexed. See Traces.md for the expected schema and Grafana setup.

OpenSearch-oriented migrations

KalDB exposes OpenSearch-compatible APIs for query and ingest workflows, which helps reuse existing shippers, clients, and dashboards. Its analytics support covers the full ClickBench query set, including multi_terms aggregations, sibling aggregations, hit sorting with filters, bucket sorting, bucket_selector HAVING-style filters, and empty-string field semantics. See Migrating.md, API-opensearch.md, and Aggregations.md.

Developer Setup

Local development

  • Import the repository as a Maven project in IntelliJ.
  • The .run/ directory contains run configurations for each node role.
  • Shared runtime defaults live in config/config.yaml.
  • CI builds with JDK 21.

Common commands

mvn package

Repository map

  • astra/: core server, APIs, indexing, query, metadata, and node implementations
  • config/: local configuration and Grafana provisioning
  • docs/: architecture, operations, APIs, and getting-started material
  • benchmarks/: JMH benchmarks for indexing and API workloads
  • tools/: helper tools such as the span generator and UI tests

Learn More

Talks And Architecture Deep Dives

The public talks complement the architecture docs well: the docs explain the components, while the talks explain the operational pressure and design tradeoffs that shaped them.

Contributing

See CONTRIBUTING.md and open issues.

About

KalDB is a cloud-native polystore for search and analytics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages