@grafema/rfdb 0.2.5-beta → 0.2.6-beta

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 +32 -37
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  *Named after the author's wife Regina (Rega for short). The Hebrew word רגע (rega, "moment") conveniently fits the concept — a flow of discrete moments captured in the graph.*
6
6
 
7
- **Warning: This package is in early alpha stage and is not recommended for production use.**
7
+ **Warning: This package is in beta stage and the API may change between minor versions.**
8
8
 
9
9
  ## Installation
10
10
 
@@ -14,9 +14,8 @@ npm install @grafema/rfdb
14
14
 
15
15
  Prebuilt binaries are included for:
16
16
  - macOS x64 (Intel)
17
- - macOS arm64 (Apple Silicon) - coming soon
18
- - Linux x64 - coming soon
19
- - Linux arm64 - coming soon
17
+ - macOS arm64 (Apple Silicon)
18
+ - Linux x64
20
19
 
21
20
  For other platforms, build from source (requires Rust):
22
21
 
@@ -31,12 +30,9 @@ cargo build --release
31
30
  ### As a CLI
32
31
 
33
32
  ```bash
34
- # Start the server (db-path is required, socket is optional)
33
+ # Start the server
35
34
  npx rfdb-server ./my-graph.rfdb --socket /tmp/rfdb.sock
36
35
 
37
- # Or if installed globally
38
- rfdb-server ./my-graph.rfdb --socket /tmp/rfdb.sock
39
-
40
36
  # Using default socket path (/tmp/rfdb.sock)
41
37
  rfdb-server ./my-graph.rfdb
42
38
  ```
@@ -71,7 +67,7 @@ server.kill();
71
67
 
72
68
  ## With Grafema
73
69
 
74
- RFDB (Rega Flow Database) is optional for Grafema. By default, Grafema uses an in-memory backend. To use RFDB for persistent storage:
70
+ RFDB is the default storage backend for Grafema. The MCP server and CLI auto-start RFDB when needed.
75
71
 
76
72
  ```javascript
77
73
  const { Orchestrator, RFDBServerBackend } = require('@grafema/core');
@@ -84,20 +80,22 @@ const orchestrator = new Orchestrator({
84
80
 
85
81
  ## Features
86
82
 
87
- - **Columnar storage**: Efficient storage for graph nodes and edges
88
- - **Deterministic IDs**: BLAKE3 hash-based node identification
89
- - **Zero-copy access**: Memory-mapped files for fast reads
90
- - **BFS/DFS traversal**: Fast graph traversal algorithms
91
- - **Version-aware**: Support for incremental analysis
83
+ - **Adaptive tuning** Auto-detects CPU cores, memory, and disk type; tunes write buffers, compaction parallelism, and prefetch strategy
84
+ - **Columnar storage** Efficient storage for graph nodes and edges
85
+ - **Deterministic IDs** BLAKE3 hash-based node identification
86
+ - **Zero-copy access** Memory-mapped files for fast reads
87
+ - **BFS/DFS traversal** Fast graph traversal algorithms
88
+ - **Parallel compaction** — Multi-threaded background compaction
92
89
 
93
90
  ## Protocol
94
91
 
95
92
  RFDB server communicates via Unix socket using MessagePack-encoded messages. The protocol supports:
96
93
 
97
- - `add_nodes` / `add_edges` - Batch insert operations
98
- - `get_node` / `find_by_attr` - Query operations
99
- - `bfs` / `dfs` - Graph traversal
100
- - `flush` / `compact` - Persistence operations
94
+ - `add_nodes` / `add_edges` Batch insert operations
95
+ - `get_node` / `find_by_attr` Query operations
96
+ - `bfs` / `dfs` Graph traversal
97
+ - `flush` / `compact` Persistence operations
98
+ - `compact_with_stats` — Compaction with statistics reporting
101
99
 
102
100
  ## Building from source
103
101
 
@@ -132,7 +130,7 @@ cargo bench --bench graph_operations -- --save-baseline my-baseline
132
130
  cargo bench --bench graph_operations -- --baseline my-baseline
133
131
  ```
134
132
 
135
- ### Benchmark Coverage
133
+ ### Benchmark Coverage (16 groups)
136
134
 
137
135
  | Category | Operations |
138
136
  |----------|-----------|
@@ -143,37 +141,34 @@ cargo bench --bench graph_operations -- --baseline my-baseline
143
141
  | **Mutation** | delete_node, delete_edge |
144
142
  | **Traversal** | bfs, reachability (forward/backward) |
145
143
  | **Maintenance** | flush, compact |
144
+ | **Analysis** | reanalysis_cost, compaction |
145
+
146
+ ### Additional Tools
147
+
148
+ ```bash
149
+ # Memory profiling
150
+ cargo run --bin memory_profile
151
+
152
+ # Benchmark report generation
153
+ cargo run --bin bench_report
154
+ ```
146
155
 
147
156
  ### CI Regression Detection
148
157
 
149
158
  Benchmarks run on PRs with the `benchmark` label (comparing PR vs main branch).
150
159
  Regressions >20% will fail the workflow.
151
160
 
152
- To trigger on your PR: add the `benchmark` label.
153
-
154
161
  ### What to Do If Benchmarks Regress
155
162
 
156
- If CI reports a regression on your PR:
157
-
158
- 1. **Check if it's noise** — re-run the workflow. CI runners have variable load; spurious regressions happen.
159
- 2. **Reproduce locally** — save baselines before/after your change and compare with `critcmp`:
163
+ 1. **Check if it's noise** re-run the workflow
164
+ 2. **Reproduce locally** — save baselines before/after:
160
165
  ```bash
161
166
  git stash && cargo bench --bench graph_operations -- --save-baseline before
162
167
  git stash pop && cargo bench --bench graph_operations -- --save-baseline after
163
168
  cargo install critcmp && critcmp before after
164
169
  ```
165
- 3. **Identify the cause** — look at which operations regressed. A regression in `add_nodes` suggests storage overhead; `bfs`/`reachability` point to traversal changes.
166
- 4. **Fix or justify** — if the regression is real, fix it. If it's an acceptable trade-off (e.g., +15% write latency for 10x better reads), document the trade-off in the PR description.
167
-
168
- ### Comparing Before/After Changes
169
-
170
- ```bash
171
- # Before making changes
172
- cargo bench --bench graph_operations -- --save-baseline before
173
-
174
- # Make changes, then compare
175
- cargo bench --bench graph_operations -- --baseline before
176
- ```
170
+ 3. **Identify the cause** — `add_nodes` regression = storage overhead; `bfs`/`reachability` = traversal changes
171
+ 4. **Fix or justify** — document trade-offs in PR description
177
172
 
178
173
  ## License
179
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafema/rfdb",
3
- "version": "0.2.5-beta",
3
+ "version": "0.2.6-beta",
4
4
  "description": "RFDB (Rega Flow Database) — high-performance disk-backed graph database server for Grafema",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",