rust-kgdb 0.1.12 → 0.2.1

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.
package/README.md CHANGED
@@ -5,6 +5,33 @@
5
5
 
6
6
  **Production-ready RDF/hypergraph database with 100% W3C SPARQL 1.1 + RDF 1.2 compliance, worst-case optimal joins (WCOJ), and pluggable storage backends.**
7
7
 
8
+ > **This npm package provides the high-performance in-memory database.**
9
+ > For **distributed cluster deployment** (1B+ triples, horizontal scaling), contact: **gonnect.uk@gmail.com**
10
+
11
+ ---
12
+
13
+ ## Deployment Modes
14
+
15
+ rust-kgdb supports three deployment modes:
16
+
17
+ | Mode | Use Case | Scalability | This Package |
18
+ |------|----------|-------------|--------------|
19
+ | **In-Memory** | Development, embedded apps, testing | Single node, volatile | ✅ **Included** |
20
+ | **Single Node (RocksDB/LMDB)** | Production, persistence needed | Single node, persistent | Via Rust crate |
21
+ | **Distributed Cluster** | Enterprise, 1B+ triples | Horizontal scaling, 9+ partitions | Contact us |
22
+
23
+ ### Need Distributed Cluster?
24
+
25
+ For enterprise deployments requiring:
26
+ - **Subject-Anchored Partitioning**: All triples for a subject guaranteed on same partition for locality
27
+ - Horizontal scaling across multiple nodes (1B+ triples)
28
+ - HDRF (High-Degree Replicated First) with power-law load balancing
29
+ - **OLAP Query Path**: SQL-based analytical execution for aggregations
30
+ - Subject-Hash Filter for accurate COUNT deduplication across replicas
31
+ - Kubernetes-native deployment with StatefulSet executors
32
+
33
+ **Request a demo: gonnect.uk@gmail.com**
34
+
8
35
  ---
9
36
 
10
37
  ## Why rust-kgdb?
@@ -559,8 +586,44 @@ Total: ~120 bytes/triple including indexes
559
586
 
560
587
  ---
561
588
 
589
+ ## Performance Benchmarks
590
+
591
+ ### By Deployment Mode
592
+
593
+ | Mode | Lookup | Insert | Memory | Dataset Size |
594
+ |------|--------|--------|--------|--------------|
595
+ | **In-Memory (npm)** | 2.78 µs | 146K/sec | 24 bytes/triple | <10M triples |
596
+ | **Single Node (RocksDB)** | 5-10 µs | 100K/sec | On-disk | <100M triples |
597
+ | **Distributed Cluster** | 10-50 µs | 500K+/sec* | Distributed | **1B+ triples** |
598
+
599
+ *Aggregate throughput across all executors with HDRF partitioning
600
+
601
+ ### SIMD + PGO Query Performance (LUBM Benchmark)
602
+
603
+ | Query | Pattern | Time | Improvement |
604
+ |-------|---------|------|-------------|
605
+ | Q5 | 2-hop chain | 53ms | **77% faster** |
606
+ | Q3 | 3-way star | 62ms | **65% faster** |
607
+ | Q4 | 3-hop chain | 101ms | **60% faster** |
608
+ | Q8 | Triangle | 193ms | **53% faster** |
609
+ | Q7 | Hierarchy | 198ms | **42% faster** |
610
+
611
+ **Average: 44.5% speedup** with zero code changes (compiler optimizations only).
612
+
613
+ ---
614
+
562
615
  ## Version History
563
616
 
617
+ ### v0.2.0 (2025-12-08) - Distributed Cluster Support
618
+
619
+ - **NEW: Distributed cluster architecture** with HDRF partitioning
620
+ - **Subject-Hash Filter** for accurate COUNT deduplication across replicas
621
+ - **DataFusion-powered OLAP** with Arrow-native vectorized execution
622
+ - Coordinator-Executor pattern with gRPC communication
623
+ - 9-partition default for optimal data distribution
624
+ - **Contact for cluster deployment**: gonnect.uk@gmail.com
625
+ - **Coming soon**: Embedding support for semantic search (v0.3.0)
626
+
564
627
  ### v0.1.12 (2025-12-01) - LMDB Backend Release
565
628
 
566
629
  - **LMDB storage backend** fully implemented (31 tests passing)
package/index.js CHANGED
@@ -1,4 +1,38 @@
1
- const { GraphDb, getVersion } = require('./rust-kgdb-napi.node')
1
+ // Platform-specific native module loading for NAPI-RS
2
+ const os = require('os')
3
+ const path = require('path')
4
+
5
+ function loadNativeBinding() {
6
+ const platform = os.platform()
7
+ const arch = os.arch()
8
+
9
+ // Map Node.js arch/platform to NAPI-RS naming convention
10
+ let nativeBinding
11
+
12
+ if (platform === 'darwin') {
13
+ if (arch === 'x64') {
14
+ nativeBinding = require('./rust-kgdb-napi.darwin-x64.node')
15
+ } else if (arch === 'arm64') {
16
+ nativeBinding = require('./rust-kgdb-napi.darwin-arm64.node')
17
+ }
18
+ } else if (platform === 'linux') {
19
+ if (arch === 'x64') {
20
+ nativeBinding = require('./rust-kgdb-napi.linux-x64-gnu.node')
21
+ } else if (arch === 'arm64') {
22
+ nativeBinding = require('./rust-kgdb-napi.linux-arm64-gnu.node')
23
+ }
24
+ } else if (platform === 'win32' && arch === 'x64') {
25
+ nativeBinding = require('./rust-kgdb-napi.win32-x64-msvc.node')
26
+ }
27
+
28
+ if (!nativeBinding) {
29
+ throw new Error(`Unsupported platform: ${platform}-${arch}. Please contact support.`)
30
+ }
31
+
32
+ return nativeBinding
33
+ }
34
+
35
+ const { GraphDb, getVersion } = loadNativeBinding()
2
36
 
3
37
  module.exports = {
4
38
  GraphDB: GraphDb, // Export as GraphDB for consistency
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rust-kgdb",
3
- "version": "0.1.12",
4
- "description": "High-performance RDF/SPARQL database with 100% W3C compliance and WCOJ execution",
3
+ "version": "0.2.1",
4
+ "description": "High-performance RDF/SPARQL database with 100% W3C compliance, WCOJ execution, and distributed cluster support",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "napi": {
@@ -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.12"
24
+ "version": "0.2.0"
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.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"
59
+ "rust-kgdb-win32-x64-msvc": "0.2.1",
60
+ "rust-kgdb-darwin-x64": "0.2.1",
61
+ "rust-kgdb-linux-x64-gnu": "0.2.1",
62
+ "rust-kgdb-darwin-arm64": "0.2.1",
63
+ "rust-kgdb-linux-arm64-gnu": "0.2.1"
64
64
  }
65
65
  }
Binary file