| Crates.io | entidb_core |
| lib.rs | entidb_core |
| version | 2.0.0-alpha.3 |
| created_at | 2025-12-25 14:46:42.628688+00 |
| updated_at | 2026-01-03 03:27:14.572876+00 |
| description | Core database engine for EntiDB |
| homepage | |
| repository | https://github.com/Tembocs/entidb |
| max_upload_size | |
| id | 2004619 |
| size | 694,091 |
Core database engine for EntiDB - an embedded entity database with ACID transactions.
entidb_core implements the complete durable storage engine:
┌─────────────────────────────────────────────────────────────────┐
│ Database │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ TransactionManager │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ WalManager │ │SegmentMgr │ │ Manifest │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ StorageBackend │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
StorageBackend implementationuse entidb_core::{Database, Config, EntityId, CollectionId};
use entidb_storage::InMemoryBackend;
// Open database with in-memory backends
let db = Database::open_in_memory(Config::default())?;
// Get or create a collection
let users = db.collection("users")?;
// Write in a transaction
db.transaction(|txn| {
let id = EntityId::new();
txn.put(users, id, b"user data".to_vec())?;
Ok(())
})?;
// Read data
let entities = db.list(users)?;
| Type | Description |
|---|---|
Database |
Main entry point with recovery and transaction API |
TransactionManager |
ACID transaction coordinator |
WalManager |
Write-ahead log for durability |
SegmentManager |
Immutable segment storage with index |
EntityId |
128-bit globally unique entity identifier |
CollectionId |
Numeric collection identifier |
| magic (4) | version (2) | type (1) | length (4) | payload (N) | crc32 (4) |
Record types: BEGIN, PUT, DELETE, COMMIT, ABORT, CHECKPOINT
| record_len (4) | collection_id (4) | entity_id (16) | flags (1) | sequence (8) | payload (N) | checksum (4) |
Flags: 0x01 = tombstone, 0x02 = encrypted (reserved)
cargo test -p entidb_core
87 tests covering:
See repository root.