⚑ Sub-millisecond reads πŸ”’ ACID-safe single file πŸ“¦ Lightweight

Enterprise-grade performance (with tradeoffs)

Benchmarks show exceptional indexed-read performance and predictable write characteristics. Numbers below come from our benchmark runs; explanations + limitations right after the graphs.

Read Performance Scaling
Write Performance & Updates
βš™οΈ
Test Machine
Intel i5-8350U β€’ 8GB RAM β€’ NVMe SSD
πŸ§ͺ
Measurement
High-res timers (process.hrtime.bigint()), isolated Node process
πŸ“Š
Workload
50k / 100k / 1M datasets β€’ indexed reads β€’ bulk write β€’ single-record update

Quick analysis

β€’ Indexed reads are effectively O(1) and stay sub-ms as data grows β€” clutch for read-heavy stuff (caches, sessions, CLIs).
β€’ Single-record updates rewrite the file to stay ACID, so cost scales with file size β€” update-heavy apps should prefer a write-optimized DB.
β€’ Initial bulk writes are tuned for ingestion and scale predictably with dataset size.
Reference-only: these results reflect our specific machine, OS and dataset shape. Yours can differ. Treat this as guidance, not a guarantee.

When to use it

Use json-database-st when your workload is β‰₯95% reads with occasional updates, you want ultra-fast local lookups, and deploying a server is overkill. Think config stores, session/state caches, local CLIs, embedded tools, or ephemeral micro-services.

When not to

If you do frequent single-record updates on big files, or need multi-writer concurrency, pick a write-optimized engine (SQLite, server DB). If you need full-text search, complex queries, or replication, consider PouchDB/CouchDB or an embedded analytic DB.

Tuning tips

Raw numbers

Dataset Size File Size Initial Write (ms) Indexed Read (ms) Single Update (ms) Read Efficiency

Competition β€” reference patterns

These charts compare expected complexity trends for offline JSON-style stores. Values are normalized (relative), not from our benchmark runs. They’re for orientation, not proof.

Reference: Read pattern comparison (normalized)
Lower is better β€’ 50k set = 1Γ— baseline
Reference: Update pattern comparison (normalized)
Lower is better β€’ relative cost by dataset size

Labels: json-database-st (indexed O(1)); LowDB / plain JSON (linear scan O(n)); NeDB / PouchDB (indexed) (β‰ˆO(log n)). Exact numbers vary by disk, cache, GC, and query shape.

Market Position & Alternatives

For context only β€” general roles, not strict benchmarks. Pick based on workload.

SolutionArchitectureStrengthsBest for
json-database-stSingle-file JSON + indexSub-ms reads β€’ simple deployRead-heavy microservices, CLIs, embedded
LowDBJSON wrapper (scan)SimplicityTiny datasets, simple configs
NeDB (archived)Document store + B-tree idxIndexed queriesSmall apps needing simple indexing
PouchDBDoc store + indexes + syncOffline-first, replicationPWAs needing CouchDB sync
Redis (server)In-memory KVUltra-fastCaching/realtime (server required)
DuckDBEmbedded columnarAnalyticsOn-device OLAP-ish queries