OxiRS TDB - High-Performance RDF Storage Engine
Status: Production Release (v0.1.0) - Released January 7, 2026
✨ Production Release: Production-ready with API stability guarantees. Semantic versioning enforced.
A high-performance, ACID-compliant RDF storage engine with multi-version concurrency control (MVCC) and advanced transaction support. OxiRS TDB provides TDB2-equivalent functionality with modern Rust performance optimizations.
Features
Core Storage Engine
- MVCC (Multi-Version Concurrency Control): Snapshot isolation with conflict detection
- ACID Transactions: Full transaction support with rollback capabilities
- B+ Tree Indexing: Six standard RDF indices (SPO, POS, OSP, SOP, PSO, OPS)
- Advanced Page Management: LRU buffer pools with efficient memory management
- Crash Recovery: ARIES-style write-ahead logging with analysis/redo/undo phases
Performance & Scalability
- High Throughput: Designed for 100M+ triples with sub-second query response
- Concurrent Access: Support for 1000+ concurrent read/write operations
- Efficient Storage: Node compression with dictionary encoding
- Memory Optimized: <8GB memory footprint for 100M triple datasets
Integration
- OxiRS Ecosystem: Seamless integration with oxirs-core and oxirs-arq
- TDB2 Compatibility: Feature parity with Apache Jena TDB2
- Modern Rust: Safe, fast, and memory-efficient implementation
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Query Layer │ │ Transaction Mgr │ │ WAL Recovery │
│ (oxirs-arq) │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────────────────────────────────────────────────────┐
│ TDB Storage Engine │
├─────────────────┬─────────────────┬─────────────────┬──────────┤
│ Triple Store │ Node Table │ B+ Tree │ MVCC │
│ │ │ Indices │ Storage │
└─────────────────┴─────────────────┴─────────────────┴──────────┘
│ │ │
┌─────────────────┬─────────────────┬─────────────────┬──────────┐
│ Page Manager │ Assembler │ Buffer Pool │ WAL │
│ │ │ │ │
└─────────────────┴─────────────────┴─────────────────┴──────────┘
Quick Start
Dependencies
Add to your Cargo.toml:
[]
= "0.1.0"
Basic Usage
use ;
use ;
// Create a new TDB store
let config = new
.with_directory
.with_cache_size // 1GB cache
.with_sync_mode;
let mut store = new?;
// Start a transaction
let mut txn = store.begin_transaction?;
// Insert triples
let subject = iri?;
let predicate = iri?;
let object = literal?;
let triple = new;
txn.insert_triple?;
// Commit transaction
txn.commit?;
// Query data
let results = store.query_pattern?;
for triple in results
Advanced Usage
use ;
// Configure with advanced options
let config = new
.with_directory
.with_cache_size // 2GB cache
.with_page_size // 8KB pages
.with_wal_enabled
.with_checkpoint_interval
.with_mvcc_enabled;
let store = new?;
// Use transactions with options
let txn_options = new
.with_isolation_level
.with_timeout;
let mut txn = store.begin_transaction_with_options?;
// Bulk insert
let triples = vec!;
txn.insert_triples_batch?;
txn.commit?;
Configuration
TdbConfig Options
let config = new
// Storage location
.with_directory
// Memory management
.with_cache_size // 1GB
.with_page_size // 8KB pages
// Transaction settings
.with_mvcc_enabled
.with_wal_enabled
.with_checkpoint_interval
// Performance tuning
.with_sync_mode
.with_compression_enabled
.with_statistics_enabled
// Concurrency
.with_max_concurrent_transactions
.with_deadlock_detection_enabled;
Testing
Run the comprehensive test suite:
# Run all tests with nextest (recommended)
# Run specific test categories
# Run with all features
# Run performance tests
Performance Benchmarks
Target Performance (100M triples)
- Query Response: <1 second for complex queries
- Load Performance: 10M triples/minute bulk loading
- Transaction Throughput: 10K transactions/second
- Memory Usage: <8GB for 100M triple database
- Recovery Time: <30 seconds for 1GB database
Benchmark Results
# Run benchmarks
# Profile with specific datasets
Development
Building
# Build with all features
# Build optimized release
# Run clippy
# Format code
Project Structure
oxirs-tdb/
├── src/
│ ├── lib.rs # Public API
│ ├── assembler.rs # Low-level operations
│ ├── nodes.rs # Node table implementation
│ ├── page.rs # Page management
│ ├── triple_store.rs # Triple storage engine
│ └── wal/ # Write-ahead logging
│ ├── mod.rs
│ ├── recovery.rs
│ └── log.rs
├── tests/ # Integration tests
├── benches/ # Performance benchmarks
├── examples/ # Usage examples
└── data/ # Test datasets
Contributing
- Follow the existing code style
- Add comprehensive tests for new features
- Update documentation for API changes
- Ensure all tests pass with
cargo nextest run --no-fail-fast - Run clippy with
cargo clippy --workspace --all-targets -- -D warnings
Compatibility
Apache Jena TDB2 Compatibility
OxiRS TDB provides feature parity with Apache Jena TDB2:
- ✅ Six standard RDF indices (SPO, POS, OSP, SOP, PSO, OPS)
- ✅ ACID transactions with MVCC
- ✅ Node compression and dictionary encoding
- ✅ B+ tree storage with efficient page management
- ✅ Write-ahead logging for crash recovery
- ✅ Statistics collection for query optimization
Migration from TDB2
// Convert TDB2 database to OxiRS TDB
use tdb2_converter;
let converter = new
.with_source_directory
.with_target_directory;
converter.convert?;
Troubleshooting
Common Issues
Q: Database corruption after crash A: Run the recovery tool:
Q: Poor query performance A: Check statistics and indices:
Q: High memory usage A: Adjust cache size in configuration:
let config = new
.with_cache_size // Reduce to 512MB
.with_page_size; // Smaller pages
Debug Mode
Enable debug logging:
init;
let config = new
.with_debug_mode
.with_statistics_enabled;
License
Licensed under the MIT License. See LICENSE for details.
Acknowledgments
- Apache Jena TDB2 for reference implementation
- Oxigraph for RDF storage patterns
- The Rust community for excellent database libraries
For more information, see the OxiRS project documentation.