Skip to main content

Crate skade_katalog

Crate skade_katalog 

Source
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 Catalog trait 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_release which commits N iceberg::TableCommit values 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§

RedbCatalog
Embedded Iceberg catalog backed by redb.
RedbCatalogBuilder
Builder for RedbCatalog.

Enums§

RedbCatalogError
Errors that may arise from the redb catalog backend itself.
WriteDurability
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-Table handles to keep resident. Entries are cheap — the parsed metadata is shared (Arc) with the L0 cache and the embedded ObjectCache is empty until something scans the table — so this can be generous. 0 disables the cache.
REDB_CATALOG_PROP_DB_PATH
Property key for the redb database file path. May be set either via RedbCatalogBuilder::db_path or in the props map passed to iceberg::CatalogBuilder::load.
REDB_CATALOG_PROP_DURABILITY
Property key for write durability. Values: immediate (default, fsync per commit), eventual, none. May be set via RedbCatalogBuilder::durability or in the props map.
REDB_CATALOG_PROP_METADATA_CACHE_BYTES
Property key for the L0 parsed-metadata cache budget, in bytes. May be set via RedbCatalogBuilder::metadata_cache_bytes or in the props map. A value of 0 disables the cache. Defaults to crate::DEFAULT_METADATA_CACHE_BYTES (128 MiB) when unset.
REDB_CATALOG_PROP_TABLE_HANDLE_CACHE_CAPACITY
Property key for the built-Table handle cache capacity (number of resident handles). May be set via RedbCatalogBuilder::table_handle_cache_capacity or in the props map. A value of 0 disables the cache. Defaults to crate::DEFAULT_TABLE_HANDLE_CACHE_CAPACITY when unset.
REDB_CATALOG_PROP_WAREHOUSE
Property key for the warehouse root URI. May be set either via RedbCatalogBuilder::warehouse_location or in the props map passed to iceberg::CatalogBuilder::load.