rust-kgdb 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +61 -1
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -108,7 +108,7 @@ rust-kgdb uses a pluggable storage architecture. **Default is in-memory** (zero
108
108
  |---------|--------------|----------|--------|
109
109
  | **InMemory** | `default` | Development, testing, embedded | ✅ **Production Ready** |
110
110
  | **RocksDB** | `rocksdb-backend` | Production, large datasets | ✅ **61 tests passing** |
111
- | **LMDB** | `lmdb-backend` | Read-heavy workloads | Planned v0.2.0 |
111
+ | **LMDB** | `lmdb-backend` | Read-heavy workloads | **31 tests passing** |
112
112
 
113
113
  ### InMemory (Default)
114
114
 
@@ -176,6 +176,58 @@ store.flush()?;
176
176
  - Unicode & binary data (4 tests)
177
177
  - Large key/value handling (8 tests)
178
178
 
179
+ ### LMDB (Memory-Mapped Persistent)
180
+
181
+ B+tree based storage with memory-mapped I/O (via `heed` crate). Optimized for **read-heavy workloads** with MVCC (Multi-Version Concurrency Control). Tested with **31 comprehensive tests**.
182
+
183
+ ```toml
184
+ # Cargo.toml - Enable LMDB backend
185
+ [dependencies]
186
+ storage = { version = "0.1.12", features = ["lmdb-backend"] }
187
+ ```
188
+
189
+ ```rust
190
+ use storage::{QuadStore, LmdbBackend};
191
+
192
+ // Create persistent database (default 10GB map size)
193
+ let backend = LmdbBackend::new("/path/to/data")?;
194
+ let store = QuadStore::new(backend);
195
+
196
+ // Or with custom map size (1GB)
197
+ let backend = LmdbBackend::with_map_size("/path/to/data", 1024 * 1024 * 1024)?;
198
+
199
+ // Features:
200
+ // - Memory-mapped I/O (zero-copy reads)
201
+ // - MVCC for concurrent readers
202
+ // - Crash-safe ACID transactions
203
+ // - Range & prefix scanning
204
+ // - Excellent for read-heavy workloads
205
+
206
+ // Sync to disk
207
+ store.flush()?;
208
+ ```
209
+
210
+ **When to use LMDB vs RocksDB:**
211
+
212
+ | Characteristic | LMDB | RocksDB |
213
+ |----------------|------|---------|
214
+ | **Read Performance** | ✅ Faster (memory-mapped) | Good |
215
+ | **Write Performance** | Good | ✅ Faster (LSM-tree) |
216
+ | **Concurrent Readers** | ✅ Unlimited | Limited by locks |
217
+ | **Write Amplification** | Low | Higher (compaction) |
218
+ | **Memory Usage** | Higher (map size) | Lower (cache-based) |
219
+ | **Best For** | Read-heavy, OLAP | Write-heavy, OLTP |
220
+
221
+ **LMDB Test Coverage:**
222
+ - Basic CRUD operations (8 tests)
223
+ - Range scanning (4 tests)
224
+ - Prefix scanning (3 tests)
225
+ - Batch operations (3 tests)
226
+ - Large key/value handling (4 tests)
227
+ - Concurrent access (4 tests)
228
+ - Statistics & flush (3 tests)
229
+ - Edge cases (2 tests)
230
+
179
231
  ### TypeScript SDK
180
232
 
181
233
  The npm package uses the in-memory backend—ideal for:
@@ -509,6 +561,14 @@ Total: ~120 bytes/triple including indexes
509
561
 
510
562
  ## Version History
511
563
 
564
+ ### v0.1.12 (2025-12-01) - LMDB Backend Release
565
+
566
+ - **LMDB storage backend** fully implemented (31 tests passing)
567
+ - Memory-mapped I/O for optimal read performance
568
+ - MVCC concurrency for unlimited concurrent readers
569
+ - Complete LMDB vs RocksDB comparison documentation
570
+ - Sample application with 87 triples demonstrating all features
571
+
512
572
  ### v0.1.9 (2025-12-01) - SIMD + PGO Release
513
573
 
514
574
  - **44.5% average speedup** via SIMD + PGO compiler optimizations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "High-performance RDF/SPARQL database with 100% W3C compliance and WCOJ execution",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "build:debug": "napi build --platform native/rust-kgdb-napi",
22
22
  "prepublishOnly": "napi prepublish -t npm",
23
23
  "test": "jest",
24
- "version": "0.1.11"
24
+ "version": "0.1.12"
25
25
  },
26
26
  "keywords": [
27
27
  "rdf",
@@ -56,10 +56,10 @@
56
56
  "*.node"
57
57
  ],
58
58
  "optionalDependencies": {
59
- "rust-kgdb-win32-x64-msvc": "0.1.11",
60
- "rust-kgdb-darwin-x64": "0.1.11",
61
- "rust-kgdb-linux-x64-gnu": "0.1.11",
62
- "rust-kgdb-darwin-arm64": "0.1.11",
63
- "rust-kgdb-linux-arm64-gnu": "0.1.11"
59
+ "rust-kgdb-win32-x64-msvc": "0.1.12",
60
+ "rust-kgdb-darwin-x64": "0.1.12",
61
+ "rust-kgdb-linux-x64-gnu": "0.1.12",
62
+ "rust-kgdb-darwin-arm64": "0.1.12",
63
+ "rust-kgdb-linux-arm64-gnu": "0.1.12"
64
64
  }
65
65
  }