| Crates.io | nitrite_fjall_adapter |
| lib.rs | nitrite_fjall_adapter |
| version | 0.1.0 |
| created_at | 2025-12-16 19:47:04.877771+00 |
| updated_at | 2025-12-16 19:47:04.877771+00 |
| description | Fjall storage adapter for Nitrite database - persistent LSM-tree storage |
| homepage | |
| repository | https://github.com/nitrite/nitrite-rust |
| max_upload_size | |
| id | 1988525 |
| size | 282,273 |
Persistent storage adapter for Nitrite using Fjall, an LSM-based key-value store.
use nitrite::nitrite::Nitrite;
use nitrite_fjall_adapter::FjallModule;
// Create with default configuration
let storage = FjallModule::with_config()
.db_path("/path/to/database")
.build();
let db = Nitrite::builder()
.load_module(storage)
.open_or_create(None, None)
.expect("Failed to create database");
Balanced settings for production workloads:
let storage = FjallModule::with_config()
.production_preset()
.db_path("/path/to/database")
.build();
Optimized for batch imports and write-heavy workloads:
let storage = FjallModule::with_config()
.high_throughput_preset()
.db_path("/path/to/database")
.build();
Reduced memory footprint for constrained environments:
let storage = FjallModule::with_config()
.low_memory_preset()
.db_path("/path/to/database")
.build();
Override specific settings after applying a preset:
let storage = FjallModule::with_config()
.production_preset()
.block_cache_capacity(128 * 1024 * 1024) // 128MB cache
.fsync_frequency(50) // More frequent fsyncs
.db_path("/path/to/database")
.build();
// Write data
let collection = db.collection("items").unwrap();
collection.insert(doc!{"key": "value"}).unwrap();
// Commit changes to disk
db.commit().unwrap();
// Close database
db.close().unwrap();
Apache License 2.0