Tonbo is an embedded database for serverless and edge runtimes.
Tonbo is an embedded database for serverless and edge runtimes.
Website | Rust Doc | Blog | Community
Tonbo is an embedded database for serverless and edge runtimes. Your data is stored as Parquet on S3, coordination happens through a manifest, and compute stays fully stateless.
Serverless compute is stateless, but your data isn't. Tonbo bridges this gap:
RecordBatch…For local development, use .on_disk("/tmp/users")? instead. See examples/ for more.
cargo add [email protected] tokioOr add to Cargo.toml:
[dependencies]
tonbo = "0.4.0-a1"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }Run with cargo run --example <name>:
01_basic: Define schema, insert, and query in 30 lines02_transaction: MVCC transactions with upsert, delete, and read-your-writes02b_snapshot: Consistent point-in-time reads while writes continue03_filter: Predicates: eq, gt, in, is_null, and, or, not04_s3: Store Parquet files on S3/R2/MinIO with zero server config05_scan_options: Projection pushdown reads only the columns you need06_composite_key: Multi-column keys for time-series and partitioned data07_streaming: Process millions of rows without loading into memory08_nested_types: Deep struct nesting + Lists stored as Arrow StructArray09_time_travel: Query historical snapshots via MVCC timestamps10_dynamic: Dynamic schemas without #[derive(Record)] (basic, metadata, composite, transactions)11_observability: Tracing spans and structured logging with OpenTelemetryTonbo implements a merge-tree optimized for object storage: writes go to WAL → MemTable → Parquet SSTables, with MVCC for snapshot isolation and a manifest for coordination via compare-and-swap:
See docs/overview.md for the full design.
Tonbo uses the tracing crate for structured logging and distributed tracing. As a library, Tonbo emits spans and events but never initializes a global subscriber - your application controls the observability configuration.
Quick setup for development:
tracing_subscriber::fmt()
.with_env_filter("info,tonbo=debug")
.init();Production with JSON output:
tracing_subscriber::fmt()
.json()
.with_env_filter("info,tonbo=info")
.init();OpenTelemetry integration:
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.install_batch(opentelemetry_sdk::runtime::Tokio)?;
tracing_subscriber::registry()
.with(tracing_opentelemetry::layer().with_tracer(tracer))
.with(tracing_subscriber::fmt::layer())
.init();See examples/11_observability.rs for complete examples and docs/rfcs/0012-logs-traces.md for design details.
Install coverage tooling once:
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov --version 0.6.12 --lockedRun coverage locally:
cargo llvm-cov --workspace --lcov --output-path lcov.info --summaryGenerate an HTML report:
cargo llvm-cov --workspace --htmlDefault run:
cargo bench --bench compaction_localExample tuned run:
TONBO_COMPACTION_BENCH_INGEST_BATCHES=768 \
TONBO_COMPACTION_BENCH_ROWS_PER_BATCH=96 \
TONBO_COMPACTION_BENCH_KEY_SPACE=4096 \
TONBO_COMPACTION_BENCH_ARTIFACT_ITERATIONS=64 \
TONBO_COMPACTION_BENCH_CRITERION_SAMPLE_SIZE=30 \
TONBO_COMPACTION_BENCH_WAL_SYNC=always \
cargo bench --bench compaction_localBenchmark configuration is env-only via TONBO_COMPACTION_BENCH_*.
For benchmark setup, scenario wiring, and JSON artifact schema/output, see:
benches/compaction_local.rsbenches/compaction/common.rsdocs/benchmark_results.md for the consolidated PR-facing summarybenches/compaction/results/compaction_local_baseline.md for raw baseline evidenceTonbo is currently in alpha. APIs may change, and we're actively iterating based on feedback. We recommend starting with development and non-critical workloads before moving to production.
Storage
Schema & Query
#[derive(Record)] or dynamic Schema)Backends
Runtime
Integrations
Observability
tracing cratetracing-opentelemetry)Apache License 2.0. See LICENSE for details.
No open issues yet, or sync has not completed.