# bison-db v0.9.0 — Final soak: concurrency under load

**The last step before 1.0.** v0.9.0 adds a sustained-load concurrency soak — the
one area that was only lightly exercised — proving the single-writer,
multi-reader model holds under real contention, including across compaction. The
API and on-disk format remain frozen and unchanged.

## What is bison-db?

An embedded, document-oriented database for Rust: store schemaless documents
entirely in-process, with no server, no network, and no external services. The
whole database is one file, writes are appended to a checksummed log, and a crash
never leaves a half-written record behind.

## What's new in 0.9.0

### Concurrency soak

bison-db follows a single-writer, multi-reader model: reads take `&self`, writes
take `&mut self`, and `Db` is `Send + Sync`, so a store is shared across threads
behind an `Arc<RwLock<Db>>`. v0.9.0 puts that model under sustained load.

The new soak (`tests/concurrency.rs`) runs **four reader threads** that
continuously read documents by id and run indexed `find` queries against a shared
`Arc<RwLock<Db>>`, while a **writer thread** performs **3,000 mutations** —
inserts, updates, deletes, and periodic `compact` calls — under the write lock.
It asserts two things:

- **Reads never panic** as the store changes under them. Whatever a reader sees —
  a live document, a just-deleted id, a freshly compacted file — comes back as a
  clean `Option`, never a crash or a torn read.
- **Final consistency.** Once the writer finishes, the store matches the writer's
  in-memory reference model exactly: same live count, every id mapping to its
  expected document.

Because compaction runs under the write lock while readers hold read locks, this
also confirms that the atomic file swap is safe with respect to concurrent
readers — the `RwLock` discipline the API encodes in its `&self`/`&mut self`
signatures holds under contention, not just in isolation.

## Performance

Unchanged from v0.8.0; see [`docs/PERFORMANCE.md`](https://github.com/jamesgober/bison-db/blob/main/docs/PERFORMANCE.md),
including the head-to-head against `redb`.

## Breaking changes

**None.** This release adds a test; no public item, and no on-disk byte, changed.

## Verification

Run on Windows x86_64 and Linux (WSL2 Ubuntu), Rust stable 1.95.x; the same
commands run in the CI matrix across Linux, macOS, and Windows on stable and
MSRV 1.85:

```bash
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --all-features -- -D warnings
cargo test
cargo test --all-features
cargo build --no-default-features
cargo build --examples
cargo audit
cargo deny check
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
```

All green; `cargo audit` and `cargo deny` clean. Test counts at this tag
(`--all-features`): 54 unit + 9 integration + 4 concurrency + 3 robustness +
3 property + 1 soak + 58 doctests.

## What's next

- **v1.0.0 — Stable.** Tag and publish with the API and format frozen here. No
  further API or format changes; 1.0 is the stability commitment.

## Installation

```toml
[dependencies]
bison-db = "0.9"

# With serde support for the document model:
bison-db = { version = "0.9", features = ["serde"] }
```

MSRV: Rust 1.85 (2024 edition).

## Documentation

- [README](https://github.com/jamesgober/bison-db/blob/main/README.md)
- [API Reference](https://github.com/jamesgober/bison-db/blob/main/docs/API.md)
- [On-disk Format](https://github.com/jamesgober/bison-db/blob/main/docs/FORMAT.md)
- [Performance](https://github.com/jamesgober/bison-db/blob/main/docs/PERFORMANCE.md)
- [Roadmap](https://github.com/jamesgober/bison-db/blob/main/dev/ROADMAP.md)
- [CHANGELOG](https://github.com/jamesgober/bison-db/blob/main/CHANGELOG.md)

---

**Full diff:** [`v0.8.0...v0.9.0`](https://github.com/jamesgober/bison-db/compare/v0.8.0...v0.9.0).
**Changelog:** [`CHANGELOG.md`](https://github.com/jamesgober/bison-db/blob/main/CHANGELOG.md#090---2026-06-08).
