Expand description
Pure-Rust, embedded Apache Iceberg catalog backed by redb.
nornir-catalog implements the iceberg::Catalog trait against a
single-file redb database. All catalog metadata (namespaces, namespace
properties, table-pointer rows) lives inside one .redb file. Iceberg
table metadata JSON / Avro manifests / Parquet data files live in whatever
storage backend the supplied FileIO points at (local fs, S3, GCS, …).
§Why redb?
- Pure Rust — no
libsqlite3, no JVM, no Postgres process. - ACID — every catalog mutation is a single redb
WriteTransaction, so concurrent writers in the same process are serialized correctly and crashes leave the database consistent. - No async runtime in the storage layer — redb is sync; the
Catalogtrait wrapper is async only because the trait demands it. - Multi-table atomic commits — because every redb write transaction
spans every table in the database, this crate exposes
RedbCatalog::atomic_releasewhich commits Niceberg::TableCommitvalues atomically. Useful when one logical release (“publish bench_runs + dep_graph + components together”) must either succeed entirely or roll back entirely.
§Quickstart
use std::sync::Arc;
use iceberg::CatalogBuilder;
use iceberg::io::LocalFsStorageFactory;
use skade_katalog::RedbCatalogBuilder;
let catalog = RedbCatalogBuilder::default()
.db_path("/var/lib/myapp/catalog.redb")
.warehouse_location("file:///var/lib/myapp/warehouse")
.with_storage_factory(Arc::new(LocalFsStorageFactory))
.load("myapp", std::collections::HashMap::new())
.await?;§What this crate is NOT
- Not a distributed catalog. Single-process. Multiple processes opening the same file will be rejected by redb’s file lock.
- Not a REST endpoint. If you need that, run something like Lakekeeper.
- Not schema-evolution-complete: iceberg-rust 0.9.1 does not yet expose
public
TransactionActions for schema mutations. That’s an upstream gap; once 0.10 lands it will work here unchanged.
Structs§
- Redb
Catalog - Embedded Iceberg catalog backed by redb.
- Redb
Catalog Builder - Builder for
RedbCatalog.
Enums§
- Redb
Catalog Error - Errors that may arise from the redb catalog backend itself.
- Write
Durability - Durability applied to every catalog-mutation commit. Maps onto redb’s durability levels.
Constants§
- DEFAULT_
METADATA_ CACHE_ BYTES - Default budget for the parsed-metadata cache (128 MiB).
- DEFAULT_
TABLE_ HANDLE_ CACHE_ CAPACITY - Default number of built-
Tablehandles to keep resident. Entries are cheap — the parsed metadata is shared (Arc) with the L0 cache and the embeddedObjectCacheis empty until something scans the table — so this can be generous.0disables the cache. - REDB_
CATALOG_ PROP_ DB_ PATH - Property key for the redb database file path. May be set either via
RedbCatalogBuilder::db_pathor in thepropsmap passed toiceberg::CatalogBuilder::load. - REDB_
CATALOG_ PROP_ DURABILITY - Property key for write durability. Values:
immediate(default, fsync per commit),eventual,none. May be set viaRedbCatalogBuilder::durabilityor in thepropsmap. - REDB_
CATALOG_ PROP_ METADATA_ CACHE_ BYTES - Property key for the L0 parsed-metadata cache budget, in bytes. May be set
via
RedbCatalogBuilder::metadata_cache_bytesor in thepropsmap. A value of0disables the cache. Defaults tocrate::DEFAULT_METADATA_CACHE_BYTES(128 MiB) when unset. - REDB_
CATALOG_ PROP_ TABLE_ HANDLE_ CACHE_ CAPACITY - Property key for the built-
Tablehandle cache capacity (number of resident handles). May be set viaRedbCatalogBuilder::table_handle_cache_capacityor in thepropsmap. A value of0disables the cache. Defaults tocrate::DEFAULT_TABLE_HANDLE_CACHE_CAPACITYwhen unset. - REDB_
CATALOG_ PROP_ WAREHOUSE - Property key for the warehouse root URI. May be set either via
RedbCatalogBuilder::warehouse_locationor in thepropsmap passed toiceberg::CatalogBuilder::load.