Performance Benchmarks
Full test suite results at 100,000 documents — CRUD, queries, transactions, HTTP API, TCP, crash recovery, and MCP. Every number from npm run node-test.
1-2 ms
Constant across all sizes
<1 ms
Direct file-per-doc read
<1 ms
In-memory cached result
330 tests
14 suites, all passing
Query Scaling (1K - 100K)
How read operations scale across dataset sizes. All timings in milliseconds.
| Dataset | Indexed | Doc ID | $gt | $gte/$lte | $in (5) | $in (50) | Limit 5 | Regex | Sort | Full Scan |
|---|---|---|---|---|---|---|---|---|---|---|
| 1K docs | 1 ms | <1 ms | 12 ms | 8 ms | 5 ms | 45 ms | 38 ms | 32 ms | 18 ms | 36 ms |
| 5K docs | 1 ms | <1 ms | 35 ms | 22 ms | 12 ms | 140 ms | 115 ms | 98 ms | 52 ms | 110 ms |
| 10K docs | 1 ms | 1 ms | 68 ms | 45 ms | 22 ms | 255 ms | 210 ms | 185 ms | 98 ms | 215 ms |
| 50K docs | 1 ms | 1 ms | 260 ms | 152 ms | 70 ms | 960 ms | 745 ms | 680 ms | 350 ms | 780 ms |
| 100K docs | 1 ms | 1 ms | 494 ms | 286 ms | 125 ms | 1,805 ms | 1,339 ms | 1,215 ms | 652 ms | 1,365 ms |
Scaling Behavior
How each query operation scales from 1K to 100K documents.
Key Takeaways
Indexed = O(1) constant time
Indexed and documentId lookups stay at 1-2 ms whether the collection has 1K or 100K docs. Each lookup reads exactly one file from disk.
ACID transactions stay fast
Single-operation transactions (insert/update/delete + commit) complete in 32-44 ms. Rollback is just 8 ms.
HTTP API is lightweight
CRUD via HTTP endpoints adds minimal overhead — insert is 35 ms, read by ID is 3 ms, query is 12 ms.
Cache eliminates repeat reads
First query hits disk; subsequent identical queries return from InMemoryCache in under 1 ms. Random TTL between 5-15 minutes.
TCP with connection pooling
10-connection pool initializes in 184 ms. TLS CRUD adds encryption overhead but stays under 100 ms per operation.
Crash-safe recovery
SIGKILL during rapid writes recovers cleanly — no corrupted documents. Recovery scans WAL + registry in ~2 seconds.
Full scan scales linearly
From 36 ms at 1K to 1,365 ms at 100K — linear scaling expected for file-per-document scans.
$in uses Set O(1) lookup
Set-optimized $in at 100K: 1,805 ms for 50 values. The value array is converted to a Set for constant-time checks.
MCP for AI agents
Full MCP server handles DB/collection/document/transaction/user/role operations. Functional tests complete in 1.7 seconds.
Run the Benchmark Suite on Your Machine
Verify throughput, sub-millisecond latencies, and ACID rollback integrity on your own hardware with a single command. Zero manual database setup required.
1-Command Quickstart
1git clone https://github.com/nexoral/AxioDB.git2cd AxioDB3npm install4npm run benchmarkAutomated pre-check: If compiled files in lib/ are missing, it runs npm run build first. Automatically removes all temporary benchmark data on completion.
Default Benchmark Profile
- • 15,000 Documents inserted in 3,000 document batches
- • Indexed Point Reads: 500 queries reporting Min, p25, p50, p75, p90, p95, p99
- • Unindexed Full Scans: 25 queries testing full collection traversal
- • Index Advantage: Live calculation of indexed speedup multiplier
Engine Verification Checks
- • Updates & Deletions: Indexed vs unindexed UpdateOne and deleteOne
- • InMemoryCache: Cold read vs 100 warm queries (~50x+ acceleration)
- • ACID Rollback: 1,000 writes staged then rolled back (0 leaked records)
- • Storage Footprint: On-disk size vs SQLite, LowDB, and raw JSON
Available CLI Arguments & Flags
| Flag | Type | Default | Description |
|---|---|---|---|
| --docs=N | number | 15000 | Total documents to insert and index (e.g. 5000, 50000, 100000, 500000) |
| --batch=N | number | 3000 | Chunk size per insertMany batch to keep memory lean |
| --queries=N | number | 500 | Number of random indexed lookups to test for percentiles |
| --unindexed=N | number | 25 | Number of unindexed full-scan lookups/updates/deletes to sample |
| --keep | boolean | false | Preserves test database files on disk for inspection instead of auto-cleaning |
Ready-to-Copy Command Combinations
1. Quick Smoke Test (5,000 docs — fast ~2s run):
1npm run benchmark -- --docs=5000 --batch=1000 --queries=100 --unindexed=102. High-Volume Stress Test (100,000 docs):
1npm run benchmark -- --docs=100000 --batch=10000 --queries=10003. Maximum Capacity Scale Test (500,000 docs):
1npm run benchmark -- --docs=500000 --batch=10000 --queries=1000 --unindexed=154. Inspect Physical Files and Index JSONL on Disk (--keep):
1npm run benchmark -- --docs=15000 --keep2ls -lh benchmark/Benchmark_TempData/BenchmarkDB/BenchDB/Users3ls -lh benchmark/Benchmark_TempData/BenchmarkDB/BenchDB/Users/indexesMethodology
See also: Comparison · Features
