Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ anyhow = "1.0.102"
axum = "0.8.9"
bincode = "1.3.3"
blake3 = "1.5"
clap = { version = "4", features = ["derive"] }
byteorder = "1.5.0"
bytes = "1.11.1"
chrono = { version = "0.4.44", features = ["serde"] }
Expand Down
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,26 @@ Ingest response counts `accepted`, `duplicates` (same id + same payload), `confl
```bash
cargo build
cargo test
cargo run # HTTP server on 127.0.0.1:8080
cargo run # HTTP server on 127.0.0.1:8080 (default)
cargo run -- --help # see admin subcommands
```

Configuration is currently hardcoded in `Config::default()` (db_root `./data`, 64 MiB memtable, 1M dedupe entries).
Configuration is currently hardcoded in `Config::default()` (db_root `./data`, 64 MiB memtable, 1M dedupe entries). The `--db-root` flag overrides the data directory.

## Admin CLI

The `usagedb` binary doubles as an admin tool. Subcommands operate on the on-disk state without needing the HTTP server running:

```
usagedb serve # HTTP server (default)
usagedb check [--deep] # manifest summary; --deep verifies every segment
usagedb rebuild-rollups --from <RFC3339> --to <RFC3339> # drop rollups + rewind watermark
usagedb inspect-segment <segment_id> # metadata + sample rows
usagedb verify-period --account <id> --from <RFC3339> --to <RFC3339> # raw vs rollup drift
usagedb export-parquet <output.parquet> # dump every raw segment to Parquet
```

All commands accept `--db-root <path>` (default `./data`). Admin commands assume the server is **not** running concurrently — file locking to prevent that is on the backlog.

## Durability contract

Expand Down
Loading
Loading