Expand description
MongrelDB core — a log-structured columnar store with sub-ms writes, learned indexes over a shared row-id space, page-level native encryption, an MVCC-tagged content-addressed cache, and an AI-native access layer.
The crate owns the WAL + memtable + Bε-tree write path, sorted-run container formats, MVCC snapshots, page cache, encryption, compaction, and indexes.
Re-exports§
pub use crate::core::DatabaseFileIdentity;pub use crate::core::LifecycleController;pub use crate::core::LifecycleState;pub use crate::core::OperationGuard;pub use ai_generation::evaluate_readiness;pub use ai_generation::readiness_action;pub use ai_generation::AiIndexGeneration;pub use ai_generation::AiIndexGenerationRegistry;pub use ai_generation::IndexId;pub use ai_generation::IndexReadinessError;pub use ai_generation::ReadinessAction;pub use auth::hash_password;pub use auth::verify_password;pub use auth::ColumnAccess;pub use auth::ColumnOperation;pub use auth::Permission;pub use auth::Principal;pub use auth::RoleEntry;pub use auth::UserEntry;pub use backup::verify_backup;pub use backup::BackupFile;pub use backup::BackupManifest;pub use backup::BackupReport;pub use be_tree::BeTree;pub use cache::PageCache;pub use catalog::IncrementalAggregateKind;pub use catalog::IncrementalAggregateOutput;pub use catalog::IncrementalAggregateView;pub use catalog::MaterializedViewEntry;pub use catalog_cmds::required_permission;pub use catalog_cmds::CatalogCommand;pub use catalog_cmds::CatalogCommandRecord;pub use catalog_cmds::CatalogDelta;pub use certification::certification_inventory;pub use certification::inventory_smoke;pub use certification::CertificationCategory;pub use certification::CertificationClass;pub use cluster_import::cluster_import_prepare;pub use cluster_import::hash_rows_canonical;pub use cluster_import::ImportPlan;pub use cluster_import::ImportTablePlan;pub use columnar::decode_column;pub use columnar::encode_column;pub use cursor::drain_cursor_to_columns;pub use cursor::Cursor;pub use cursor::MultiRunCursor;pub use cursor::NativePageCursor;pub use database::lock_table_with_context;pub use database::AuthorizedReadSnapshot;pub use database::AuthorizedReadStamp;pub use database::CdcBatch;pub use database::ChangeEvent;pub use database::CheckIssue;pub use database::Database;pub use database::DatabaseCore;pub use database::DatabaseOpenMetrics;pub use database::ExternalTriggerBaseWrite;pub use database::ExternalTriggerBridge;pub use database::ExternalTriggerWrite;pub use database::ExternalTriggerWriteResult;pub use database::OpenOptions;pub use database::ReadAuthorization;pub use database::TableGenerationStats;pub use database::TableGuard;pub use database::TableHandle;pub use database::TablePinsReport;pub use database::TableReadGeneration;pub use database::DEFAULT_MEMORY_BUDGET_BYTES;pub use database::DEFAULT_TEMP_DISK_BUDGET_BYTES;pub use embedding::EmbeddingError;pub use embedding::EmbeddingModelMeta;pub use embedding::EmbeddingProvider;pub use embedding::EmbeddingProviderRegistry;pub use embedding::EmbeddingSource;pub use embedding::FixedVectorProvider;pub use encryption::Cipher;pub use encryption::PlaintextCipher;pub use engine::AggState;pub use engine::ApproxAgg;pub use engine::ApproxResult;pub use engine::CachedAgg;pub use engine::ColumnStat;pub use engine::IncrementalAggResult;pub use engine::IndexBuildPolicy;pub use engine::NativeAgg;pub use engine::NativeAggResult;pub use engine::ReadGeneration;pub use engine::Table;pub use engine::TableDeltas;pub use epoch::Epoch;pub use epoch::EpochAuthority;pub use epoch::EpochClock;pub use epoch::MaintenanceReceipt;pub use epoch::Snapshot;pub use error::MongrelError;pub use error::Result;pub use execution::CancellationReason;pub use execution::ExecutionControl;pub use external_table::ExternalTableDefinition;pub use external_table::ExternalTableEntry;pub use external_table::ModuleArg;pub use external_table::ModuleCapabilities;pub use gc::CheckReport;pub use gc::DoctorReport;pub use gc::GcReport;pub use gc::GcVersionsReport;pub use handle::DatabaseHandle;pub use handle::HandleAccess;pub use handle::HandleIdentity;pub use handle::OpenIdentity;pub use index::AnnIndex;pub use index::BitmapIndex;pub use index::ColumnLearnedRange;pub use index::FmIndex;pub use index::HotIndex;pub use index::IndexFamilyGeneration;pub use index::IndexGeneration;pub use index::LearnedIndex;pub use index::SparseIndex;pub use jobs::CancellationToken;pub use jobs::JobError;pub use jobs::JobKind;pub use jobs::JobProgress;pub use jobs::JobRecord;pub use jobs::JobRegistry;pub use jobs::JobState;pub use jobs::JobTarget;pub use jobs::JOBS_FILENAME;pub use locks::LockError;pub use locks::LockKey;pub use locks::LockManager;pub use locks::LockMode;pub use locks::LockRequest;pub use manager::DatabaseManager;pub use manifest::TtlPolicy;pub use memory::EscalationLevel;pub use memory::EscalationThresholds;pub use memory::GovernorConfig;pub use memory::GovernorStats;pub use memory::MemoryClass;pub use memory::MemoryError;pub use memory::MemoryGovernor;pub use memory::Reclaimable;pub use memory::Reservation;pub use memory::SpillGrant;pub use memtable::Memtable;pub use memtable::Row;pub use memtable::Value;pub use migrate_mysql::dialect_matrix;pub use migrate_mysql::map_mysql_type;pub use migrate_mysql::plan_mysql_migration;pub use migrate_mysql::run_migrate_pipeline;pub use migrate_mysql::CdcOp;pub use migrate_mysql::DialectFeature;pub use migrate_mysql::DialectSupport;pub use migrate_mysql::MemoryMigrateIo;pub use migrate_mysql::MigrateIo;pub use migrate_mysql::MigrateRunReport;pub use migrate_mysql::MigrateStage;pub use migrate_mysql::MigrateTablePlan;pub use migrate_mysql::MysqlMigratePlan;pub use migrate_mysql::MysqlWireRequest;pub use migrate_mysql::SourceRow;pub use migrate_mysql::TypeMapping;pub use migrate_mysql::DEFAULT_COPY_BATCH;pub use migrate_mysql::DUAL_WRITE_WARNING;pub use mutable_run::MutableRun;pub use node_governor::GovernorAction;pub use node_governor::NodeMemoryGovernor;pub use node_governor::NodePressureInputs;pub use ops_jobs::OpsJob;pub use ops_jobs::OpsJobError;pub use ops_jobs::OpsJobKind;pub use ops_jobs::OpsJobState;pub use ops_jobs::OpsJobStore;pub use page::CachedPage;pub use page::Encoding;pub use page::PageStat;pub use pitr::read_pitr_manifest;pub use pitr::restore_pitr;pub use pitr::PitrArchiveManifest;pub use pitr::PitrArchiveReport;pub use pitr::PitrChunkRef;pub use pitr::PitrCommitPoint;pub use pitr::PitrCredentials;pub use pitr::PitrTarget;pub use procedure::ProcedureBody;pub use procedure::ProcedureCallOutput;pub use procedure::ProcedureCallResult;pub use procedure::ProcedureCallRow;pub use procedure::ProcedureCondition;pub use procedure::ProcedureEntry;pub use procedure::ProcedureMode;pub use procedure::ProcedureParam;pub use procedure::ProcedureStep;pub use procedure::ProcedureValue;pub use procedure::StoredProcedure;pub use security_hardening::node_cert_matches_id;pub use security_hardening::redact_secrets;pub use security_hardening::validate_jwt_claims;pub use security_hardening::JwtClaims;pub use security_hardening::JwtError;pub use security_hardening::JwtValidationConfig;pub use security_hardening::KeyRotationRecord;pub use security_hardening::KmsWrappedKey;pub use security_hardening::ScramVerifier;pub use security_hardening::ServiceToken;pub use security_hardening::ServiceTokenRegistry;pub use query::Condition;pub use query::Query;pub use replicated_apply::EngineSnapshot;pub use replicated_apply::EngineSnapshotFile;pub use replicated_apply::EngineSnapshotTable;pub use replicated_apply::ReplicatedTxnPayload;pub use replicated_apply::COMMAND_TYPE_CATALOG_COMMAND;pub use replicated_apply::COMMAND_TYPE_MAINTENANCE;pub use replicated_apply::ENGINE_SNAPSHOT_FORMAT_VERSION;pub use replicated_apply::REPLICATED_TXN_FORMAT_VERSION;pub use replication::is_replica;pub use replication::replica_epoch;pub use replication::replica_source_id;pub use replication::write_replica_epoch;pub use replication::ReplicationBatch;pub use replication::ReplicationSnapshot;pub use reservoir::Reservoir;pub use resource::ResourceError;pub use resource::ResourceGroup;pub use resource::ResourceGroupRegistry;pub use resource::WorkloadClass;pub use retention::OwnedSnapshotGuard;pub use retention::PinGuard;pub use retention::PinInfo;pub use retention::PinRegistry;pub use retention::PinSource;pub use retention::PinsReport;pub use retention::SnapshotGuard;pub use retention::SnapshotRegistry;pub use rowid::RowId;pub use rowid::RowIdAllocator;pub use scheduler::ClassConfig;pub use scheduler::ClassStats;pub use scheduler::HierarchicalScheduler;pub use scheduler::SchedulerError;pub use scheduler::SchedulerStats;pub use scheduler::TenantQuota;pub use scheduler::WorkItem;pub use schema::AlterColumn;pub use schema::ColumnDef;pub use schema::ColumnFlags;pub use schema::DefaultExpr;pub use schema::IndexDef;pub use schema::IndexKind;pub use schema::Schema;pub use schema::TypeId;pub use security::ColumnMask;pub use security::MaskStrategy;pub use security::PolicyCommand;pub use security::RowPolicy;pub use security::SecurityCatalog;pub use security::SecurityExpr;pub use sorted_run::read_column_dir;pub use sorted_run::read_header;pub use sorted_run::write_run;pub use sorted_run::write_run_with;pub use sorted_run::ColumnPayload;pub use sorted_run::RunHeader;pub use sorted_run::RunReader;pub use sorted_run::RunSpec;pub use sorted_run::RunWriter;pub use spill::SpillConfig;pub use spill::SpillError;pub use spill::SpillHandle;pub use spill::SpillManager;pub use spill::SpillReader;pub use spill::SpillSession;pub use spill::SpillStats;pub use spill::SpillWriter;pub use storage_mode::StorageMode;pub use storage_mode::StorageModeError;pub use storage_mode::STORAGE_MODE_FILENAME;pub use trace::IndexRebuild;pub use trace::QueryTrace;pub use trace::ScanMode;pub use trigger::StoredTrigger;pub use trigger::TriggerCell;pub use trigger::TriggerCondition;pub use trigger::TriggerConfig;pub use trigger::TriggerDefinition;pub use trigger::TriggerEntry;pub use trigger::TriggerEvent;pub use trigger::TriggerExpr;pub use trigger::TriggerProgram;pub use trigger::TriggerRaiseAction;pub use trigger::TriggerStep;pub use trigger::TriggerTarget;pub use trigger::TriggerTiming;pub use trigger::TriggerValue;pub use txn::IsolationLevel;pub use txn::OwnedRow;pub use txn::PutResult;pub use txn::UpsertAction;pub use txn::UpsertActionKind;pub use txn::UpsertResult;pub use wal::AddedRun;pub use wal::DdlOp;pub use wal::Op;pub use wal::Record;pub use wal::Wal;pub use wal::WalReader;pub use wal::SYSTEM_TXN_ID;
Modules§
- ai_
generation - AI index generations (spec section 13.3, Stage 4C).
- auth
- User, role, and credential management for MongrelDB’s catalog-level auth.
- auth_
state - Shared auth state for per-table enforcement.
- backup
- Online backup manifest and verification.
- be_tree
- Buffered Bε-tree (B-epsilon-tree) over composite
(RowId, Epoch)keys — the Phase 1 memtable target. - cache
- MVCC-tagged, content-addressed page cache.
- catalog
- DB-wide catalog checkpoint (spec §5.1).
- catalog_
cmds - Versioned catalog commands (spec §10.6, S1F-001).
- certification
- Production certification harness inventory (spec section 14.6, Stage 5F).
- cluster_
import - Standalone → cluster import groundwork (spec section 5.2, Stage 2E).
- columnar
- Plain columnar encode/decode for the prototype type set.
- commit_
log - Standalone
mongreldb_log::CommitLogadapter (spec section 9.4, FND-004). - compaction
- Tiered compaction (Phase 5) with snapshot retention.
- constraint
- Engine-side declarative constraints (unique, foreign key, check) enforced
authoritatively inside the core transaction path. Opt-in per-table via
crate::schema::Schema::constraints; tables with an empty constraint set (the default — including every legacy table and every Kit-managed table) behave exactly as before. This subsystem is independent of the Kit’s own guard-table mechanism: the Kit continues to enforce its constraints exactly as before, and these engine constraints only fire for tables whose schema carries a non-emptyTableConstraints. - core
- Shared storage-core plumbing (spec §10.1, S1A-003/S1A-004).
- cursor
- Lazy, page-aware native-column cursor for streaming scans (Phase 6.2).
- database
- Multi-table
Databasecontainer (spec §5, §6, §10). - durable_
file - embedding
- Pluggable embedding generation (optional layer over stored vectors).
- encryption
- Native page-level encryption (optional, behind the
encryptionfeature). - engine
- The engine tying the write and read paths together.
- epoch
- error
- execution
- Shared cooperative cancellation and deadline control.
- external_
table - gc
- Operational tools: garbage collection and integrity check.
- global_
idx - Global index file —
_idx/global.idx. - handle
DatabaseHandle: a lightweight caller-specific object referencing oneDatabaseCore(spec §10.1, S1A-001).- index
- Indexes. All share the
crate::rowid::RowIdspace so multi-condition queries intersect with SIMD bitmap ops. - jobs
- Persistent online jobs (spec section 10.6, S1F-002/S1F-003).
- locks
- Key and predicate lock manager with deadlock detection (spec section 10.2, S1B-003). Implemented in the Stage 1 wave.
- manager
- Process-local shared-core registry:
DatabaseManager(spec §10.1, S1A-002/S1A-003). - manifest
- Manifest — the atomic pointer to the current set of sorted runs.
- memory
- Global memory governor (spec section 10.5, S1E-003).
- memtable
- In-memory write buffer (the “memtable”).
- migrate_
mysql - MySQL migration path (spec section 14.1, Stage 5A).
- mutable_
run - Mutable run tier — the LSM layer between the skip-list memtable and the
immutable
.srsorted runs (Phase 11.1). - node_
governor - Node-level memory governor wiring (spec section 13.2, Stage 4B).
- ops_
jobs - Online operations as persistent resumable jobs (spec section 14.5, Stage 5E).
- page
- pitr
- Point-in-time recovery archives built from an online base backup plus checksummed, transaction-complete logical WAL chunks.
- pma
- Packed Memory Array — a cache-oblivious sorted array with amortized
O(log² n)insert and no full rewrite per insert. - procedure
- query
- Tool-call-native query surface.
- replicated_
apply - Replicated-mode apply payloads and the engine snapshot image (spec sections 4.4, 11.5; Stage 2E).
- replication
- Replication bootstrap image and follower metadata.
- reservoir
- Reservoir sampling for approximate analytics (Phase 8.2).
- resource
- Workload classes and resource groups (spec section 10.5, S1E-001/S1E-002).
- retention
- Global snapshot-retention registry for a multi-table
Database. - rowid
- scheduler
- Hierarchical scheduler (spec section 13.1, Stage 4A).
- schema
- security
- Persistent row policies and column masking.
- security_
hardening - Security hardening helpers (spec section 14.3, Stage 5C).
- sorted_
run - Sorted Run — the immutable columnar unit (
.sr). - spill
- Spill manager for query execution (spec section 10.5, S1E-004).
- storage_
mode - Durable storage-mode marker (spec section 5.3, Stage 2E).
- trace
- Query path instrumentation (OPTIMIZATIONS.md Priority 0 / 16).
- trigger
- tsv
- TSV import/export (MongrelDB-compatible format).
- txn
- Cross-table transactions on the shared WAL (spec §8.2, single-applier subset — parallelism arrives in P3).
- wal
- Append-only, group-commit, torn-write-safe WAL.