Expand description
§Kimberlite
Compliance-native database for regulated industries.
Kimberlite is built on a replicated append-only log with deterministic projection to a custom storage engine. This provides:
- Correctness by design - Ordered log → deterministic apply → snapshot
- Full audit trail - Every mutation is captured in the immutable log
- Point-in-time recovery - Replay from any offset
- Compliance by construction - Built-in durability and encryption
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Kimberlite │
│ ┌─────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Log │ → │ Kernel │ → │ Store │ → │ Query │ │
│ │(append) │ │(pure FSM) │ │(B+tree) │ │ (SQL) │ │
│ └─────────┘ └───────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘§Quick Start
ⓘ
use kimberlite::{Kimberlite, TenantId, DataClass};
// Open database
let db = Kimberlite::open("./data")?;
// Get tenant handle
let tenant = db.tenant(TenantId::new(1));
// Create a stream
let stream_id = tenant.create_stream("events", DataClass::NonPHI)?;
// Append events
tenant.append(stream_id, vec![b"event1".to_vec(), b"event2".to_vec()])?;
// Query (point-in-time support)
let results = tenant.query("SELECT * FROM events LIMIT 10", &[])?;§Modules
- SDK Layer:
Kimberlite,TenantHandle- Main API - Foundation: Types, crypto, storage primitives
- Query: SQL subset for compliance lookups
Structs§
- BTree
Store - B+tree-based projection store implementation.
- Chain
Hash - A 32-byte SHA-256 hash used for chaining records.
- Column
Def - Definition of a table column.
- Column
Name - SQL column name.
- Directory
- Routes stream placements to VSR replication groups.
- Field
Key - A key for encrypting a specific field, derived from a tenant key.
- GroupId
- Unique identifier for a replication group.
- KAnonymity
Result - Result of a k-anonymity check.
- Key
- A key in the projection store.
- Kimberlite
- The main Kimberlite database handle.
- Kimberlite
Config - Configuration for opening a Kimberlite database.
- Offset
- Position of an event within a stream.
- Query
Engine - Query engine for executing SQL against a projection store.
- Query
Result - Result of executing a query.
- Record
- A single record in the event log.
- Reversible
Token - Encrypted token that can be reversed with the key.
- Schema
- Schema registry mapping SQL names to store types.
- Schema
Builder - Builder for constructing schemas fluently.
- State
- The kernel’s in-memory state.
- Storage
- Append-only event log storage with checkpoint support.
- Stream
Id - Unique identifier for a stream within the system.
- Stream
Metadata - Metadata describing a stream’s configuration and current state.
- Stream
Name - Human-readable name for a stream.
- Table
Def - Definition of a table in the schema.
- TableId
- Unique identifier for a table within the store.
- Table
Name - SQL table name.
- Tenant
Handle - A tenant-scoped handle for database operations.
- Tenant
Id - Unique identifier for a tenant (organization/customer).
- Token
- A deterministic token for consistent pseudonymization.
- Write
Batch - A batch of write operations to apply atomically.
Enums§
- Command
- A command to be applied to the kernel.
- Data
Class - Classification of data for compliance purposes.
- Data
Type - SQL data types supported by the query engine.
- Date
Precision - Precision level for date truncation.
- Directory
Error - Errors that can occur during directory lookups.
- Effect
- An effect to be executed by the runtime.
- Execute
Result - Result of executing a DDL/DML statement.
- GeoLevel
- Geographic hierarchy levels for generalization.
- Kernel
Error - Errors that can occur when applying commands to the kernel.
- Kimberlite
Error - Errors that can occur during Kimberlite operations.
- Mask
Style - Style for masking sensitive values.
- Placement
- Placement policy for a stream.
- Query
Error - Errors that can occur during query parsing and execution.
- Region
- Geographic region for data placement.
- Storage
Error - Errors that can occur during storage operations.
- Store
Error - Errors that can occur during store operations.
- Value
- A typed SQL value.
- WriteOp
- A single write operation within a batch.
Traits§
- Projection
Store - Trait for projection stores that maintain derived state from the log.
Functions§
- apply_
committed - Applies a committed command to the state, producing new state and effects.
- chain_
hash - Computes the next hash in the chain.
- check_
k_ anonymity - Checks if a set of quasi-identifier combinations achieves k-anonymity.
- decrypt_
field - Decrypts a field value encrypted with
encrypt_field. - encrypt_
field - Encrypts a field value with randomized encryption.
- generalize_
age - generalize_
numeric - Generalizes a numeric value into a range.
- generalize_
zip - Generalizes a ZIP code by preserving only the first N digits.
- mask
- Masks a string value according to the specified style.
- redact
- Returns
Noneto represent a fully redacted value. - tokenize
- Creates a deterministic token from a value.
- truncate_
date - Truncates a date to the specified precision.