Skip to content

InferaDB common — shared Rust utilities, crates, and foundational libraries

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

inferadb/common

InferaDB Logo

InferaDB Common

Discord License CI crates.io

Shared storage abstractions for InferaDB services.

Important

Under active development. Not production-ready.

This repository provides the storage abstraction layer used by InferaDB Engine and InferaDB Control. It defines a common interface for persistent storage with pluggable backends.

Crates

Crate Description
inferadb-common-storage Storage backend trait and in-memory implementation
inferadb-common-storage-ledger Ledger-backed storage implementation

Installation

cargo add inferadb-common-storage
cargo add inferadb-common-storage-ledger

Usage

use inferadb_common_storage::{StorageBackend, MemoryBackend};

// Create an in-memory backend (useful for testing)
let backend = MemoryBackend::new();

// Basic operations
backend.set(b"key", b"value").await?;
let value = backend.get(b"key").await?;
backend.delete(b"key").await?;

// Range queries
let entries = backend.get_range(b"prefix:", b"prefix:\xff").await?;

// Transactions
let mut tx = backend.transaction();
tx.set(b"key1", b"value1");
tx.set(b"key2", b"value2");
tx.commit().await?;

For production use with cryptographic auditability, use the Ledger backend:

use inferadb_common_storage_ledger::{LedgerBackend, LedgerBackendConfig};

let config = LedgerBackendConfig::builder()
    .servers(["http://ledger.example.com:50051"])
    .build();

let backend = LedgerBackend::new(config).await?;

Contributing

Prerequisites

  • Rust 1.92+
  • mise for synchronized development tooling
  • just for convenient development commands

Build and Test

git clone https://github.com/inferadb/common.git
cd common

# Install development tools
mise trust && mise install

# Build
just build

# Run tests
just test

# Full check (build + clippy + test + format)
just check

Community

Join us on Discord for questions and discussions.

License

Dual-licensed under MIT or Apache 2.0.

About

InferaDB common — shared Rust utilities, crates, and foundational libraries

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages