janql

Crates.iojanql
lib.rsjanql
version0.3.1
created_at2025-12-28 10:36:34.435502+00
updated_at2026-01-04 08:30:29.891529+00
descriptionJanQL is a lightweight, persistent key-value store written in Rust.
homepage
repositoryhttps://github.com/alejandrogonzalvo/janql
max_upload_size
id2008578
size276,684
Alejandro Gonzalvo (alejandrogonzalvo)

documentation

README

JanQL

JanQL is a lightweight, persistent key-value store written in Rust. It features an append-only log for durability, JSON serialization, and an in-memory HashMap for fast reads.

Features

  • Simple API: set, get, del.
  • Persistence: Append-only log with crash recovery (load).
  • Compaction: flush operation to compact the log.
  • Performance: In-memory reads, constant-time writes.

Usage

use janql::Database;

fn main() {
    let mut db = Database::new("my.db");
    
    db.set("key".to_string(), "value".to_string());
    println!("{:?}", db.get("key"));
    
    db.del("key");
}

Testing & Benchmarking

Unit Tests

Run the standard test suite to verify correctness:

cargo test

Benchmarks

We use criterion for benchmarking.

Run Standard Benchmarks: Measures write, read, and load performance for 100, 1k, and 10k items.

cargo bench

Run Comparison Benchmarks: Compares JanQL against sled (requires comparison feature).

cargo bench --features comparison

Performance Regression Testing

We maintain performance baselines to detect regressions.

Save a New Baseline: To save the current performance as a named baseline (e.g., v0.1):

cargo bench -- --save-baseline v0.1

Compare Against Baseline: To compare the current code against a saved baseline:

cargo bench -- --baseline v0.1
Commit count: 0

cargo fmt