Architecture Overview
KalamDB combines SQL execution, realtime delivery, and multi-tier storage in one runtime.
Major Runtime Layers
kalamdb-api: HTTP + WebSocket surface (/v1/api/*,/v1/ws)kalamdb-core: orchestration, SQL execution flow, authorization checks, job dispatchkalamdb-sql: SQL parser/classifier/extensions (SUBSCRIBE,TOPIC,STORAGE,EXECUTE AS USER, etc.)kalamdb-store+ RocksDB: hot write/read pathkalamdb-filestore+ Parquet: cold segments and manifestskalamdb-raft: cluster consensus and replication
Runtime Flow
Data Directory Layout
Default paths are rooted at storage.data_path (usually ./data):
data/
├── rocksdb/ # hot tier
├── storage/ # cold parquet tier
├── snapshots/ # raft snapshots
└── streams/ # stream table logsTable-specific cold paths are generated from templates:
- shared tables:
storage.shared_tables_template - user tables:
storage.user_tables_template
Query Path (Simplified)
- API receives SQL (
POST /v1/api/sql) with bearer auth. - SQL is parsed/classified (standard + KalamDB extensions).
- Authorization and table-type rules are applied.
- Query executes against hot tier, cold tier, or both.
- Response returns normalized JSON schema/rows.
- Optional change notifications flow to subscriptions/topics.
For detailed flush behavior and cold-tier movement, see Storage Tiers.
Technology Stack
| Component | Technology | Notes |
|---|---|---|
| Language | Rust 1.92+ | concurrency + memory safety |
| Query engine | Apache DataFusion 52.x | SQL planning/execution |
| Columnar format | Apache Arrow 57.x | in-memory batches |
| Cold storage | Apache Parquet 57.x | compressed columnar files |
| Hot storage | RocksDB 0.24 | write-heavy low-latency path |
| API runtime | Actix Web 4.12 | HTTP + WebSocket |
| Auth | bcrypt + JWT | password + token flows |
Continue Reading
Last updated on