Skip to main content

Crate azoth

Crate azoth 

Source
Expand description

Axiom: A TEE-safe, high-performance storage subsystem

Axiom provides a complete storage solution with:

  • Canonical store: Transactional KV + append-only event log (LMDB)
  • Projection store: Queryable SQL tables derived from events (SQLite)
  • Projector: Event processing with batching and backpressure
  • Migrations: Schema versioning and evolution
  • Event handlers: Extensible event processing pipeline

§Quick Start

use azoth::prelude::*;

// Open database
let db = AzothDb::open("./data")?;

// Write state + events atomically
let mut txn = db.canonical().write_txn()?;
txn.put_state(b"key", b"value")?;
txn.append_event(b"event_data")?;
txn.commit()?;

// Run projector
db.projector().run_once()?;

Re-exports§

pub use backup::BackupOptions;
pub use backup::EncryptionKey;
pub use checkpoint::CheckpointConfig;
pub use checkpoint::CheckpointManager;
pub use checkpoint::CheckpointMetadata;
pub use checkpoint::CheckpointStorage;
pub use checkpoint::LocalStorage;
pub use circuit_breaker::BreakerMetrics;
pub use circuit_breaker::BreakerMetricsSnapshot;
pub use circuit_breaker::BreakerState;
pub use circuit_breaker::CircuitBreaker;
pub use circuit_breaker::CircuitBreakerConfig;
pub use db::AzothDb;
pub use dead_letter_queue::DeadLetterQueue;
pub use dead_letter_queue::FailedEvent;
pub use dlq_replayer::BackoffStrategy;
pub use dlq_replayer::DlqMetrics;
pub use dlq_replayer::DlqMetricsSnapshot;
pub use dlq_replayer::DlqReplayConfig;
pub use dlq_replayer::DlqReplayer;
pub use dlq_replayer::ReplayPriority;
pub use event_format::Event;
pub use event_format::EventCodec;
pub use event_format::EventTypeRegistry;
pub use event_format::JsonCodec;
pub use event_format::MsgPackCodec;
pub use event_handler::BatchConfig;
pub use event_handler::BatchEvent;
pub use event_handler::EventHandler;
pub use event_handler::EventHandlerRegistry;
pub use event_processor::ErrorAction;
pub use event_processor::ErrorStrategy;
pub use event_processor::EventProcessor;
pub use event_processor::EventProcessorBuilder;
pub use event_processor::ShutdownHandle;
pub use incremental_backup::BackupRetention;
pub use incremental_backup::BackupType;
pub use incremental_backup::IncrementalBackup;
pub use incremental_backup::IncrementalBackupConfig;
pub use incremental_backup::IncrementalBackupManifest;
pub use ipfs::IpfsClient;
pub use ipfs::IpfsProvider;
pub use ipfs_storage::IpfsStorage;
pub use migration::FileMigration;
pub use migration::Migration;
pub use migration::MigrationHistoryEntry;
pub use migration::MigrationInfo;
pub use migration::MigrationManager;
pub use transaction::PreflightContext;
pub use transaction::Transaction;
pub use transaction::TransactionContext;
pub use typed_values::Array;
pub use typed_values::Set;
pub use typed_values::TypedValue;
pub use typed_values::I256;
pub use typed_values::U256;

Modules§

backup
Backup and restore with optional encryption and compression
checkpoint
Checkpoint system for periodic backups with pluggable storage backends
circuit_breaker
Circuit Breaker Pattern
db
Unified Axiom database interface
dead_letter_queue
Dead Letter Queue
dlq_replayer
Automatic Dead Letter Queue Replay
event_format
Event format with structured payloads
event_handler
Event handler system
event_processor
Continuous Event Processor
incremental_backup
Incremental Backup System
ipfs
IPFS integration for Azoth backups
ipfs_storage
IPFS storage backend for checkpoints
migration
Database migration system
prelude
Axiom Prelude
recovery_file
Local recovery file management
transaction
Enhanced transaction API with preflight, state updates, and event logging
typed_values
Typed value support for the KV store

Macros§

migration
Helper macro to define a migration
simple_handler
Helper macro to create a simple event handler

Structs§

BackupInfo
Information about a backup operation
BackupManifest
Backup manifest for deterministic restore
CanonicalConfig
Configuration for canonical store
CanonicalMeta
Metadata about the canonical store state
CommitInfo
Information about a committed transaction
DecodedEvent
Decoded event representation
LmdbCanonicalStore
LMDB-backed canonical store
LockManager
Lock manager for stripe locking during preflight phase
PreflightResult
Preflight validation result
ProjectionConfig
Configuration for projection store
Projector
Projector: consumes events from canonical store and applies to projection
ProjectorConfig
Configuration for the projector
ProjectorStats
SqliteProjectionStore
SQLite-backed projection store

Enums§

AzothError
SyncMode
SynchronousMode

Traits§

CanonicalStore
Canonical store: transactional KV + append-only event log
CanonicalTxn
Transaction for canonical store operations
EventApplier
Event applier: apply events to projection store
EventDecoder
Event decoder: convert raw bytes to structured events
EventIter
Iterator over events in the canonical store
ProjectionStore
Projection store: SQL database for derived tables
ProjectionTxn
Transaction for projection store operations
StateIter
Iterator over key-value pairs in the canonical store

Type Aliases§

EventBytes
Raw event bytes (opaque to storage layer)
EventId
Event identifier - strictly monotonic u64
Result