How pjtatlow/jammdb works
Main Components
a. Core Database Components:
• Database Manager (db.rs)
• Transaction Manager (tx.rs)
• Bucket Storage (bucket.rs)
• B+ Tree Implementation (node.rs, page_node.rs)
• Page Management (page.rs)
• Memory Management (freelist.rs)
• Metadata Handler (meta.rs)
b. Supporting Components:
• Error Handling System (errors.rs)
• Byte Management (bytes.rs)
• Cursor Implementation (cursor.rs)
┌─ Database API (lib.rs) ─┐
• Open/Close Operations│
• Transaction Handling │
┌─ Transaction Manager ─┐
• Read-only Txs │
• Write Txs │
┌─ Bucket Management ─┐ ┌─ B+ Tree ─┐
• Key-Value Pairs │ ─► │ Nodes │
• Nested Buckets │ │ Pages │
┌─ Page Manager ─┐ ┌─ Memory Manager ─┐
• Page Alloc │ ◄► │ Free List │
• Page Access │ │ Memory Mapping │
Key Relationships to Highlight
• One-way flow from Bucket Management to B+ Tree
• Page Manager with both B+ Tree and Memory Manager
• Error handling system connecting to all components
Implementation Details to Note
• The single-level store architecture
• The separation between read and write transactions
• The bucket hierarchy system
• The page management system
• The memory mapping strategy
Additional Elements
• External interfaces (file system interaction)
• Serialization/deserialization support
• Error propagation paths
• Testing infrastructure