1.2 KiB
1.2 KiB
Persistent B+ Tree in Rust
A high-performance, disk-backed B+ Tree implementation designed for manual page management and efficient data retrieval. This project explores the intersection of database engine internals and Rust's memory safety.
Key Features
- Disk Persistence: Implements a custom
FileStoragelayer that handles reading/writing nodes as discrete pages. - B+ Tree Logic: Supports insertion, search, and tree traversal with internal/leaf node splitting.
- Performance Tracking: Built-in statistics for monitoring Page Reads, Page Writes, and total I/O operations.
- REPL Interface: Interactive command-line interface for real-time tree manipulation.
Technical Implementation
The tree is built with a focus on implementation-level transparency:
- Storage Abstraction: Uses a
Storagetrait to allow for interchangeable backends (e.g., in-memory vs. file-backed). - Serialization: Utilizes
bincodefor efficient binary encoding of nodes. - Node Structure: Custom
InternalandLeafnode definitions with configurableDEGREE.
Getting Started
Prerequisites
- Cargo
Build and Run
cargo run