Skip to content

Add store-slatedb: a SlateDB tuple-store module - #8

Merged
maxweber merged 2 commits into
mainfrom
slatedb-store
Jul 15, 2026
Merged

Add store-slatedb: a SlateDB tuple-store module#8
maxweber merged 2 commits into
mainfrom
slatedb-store

Conversation

@maxweber

Copy link
Copy Markdown
Owner

Summary

The first non-default dbval.store backend — SlateDB, an embedded ordered key-value store on object storage (S3/GCS/local fs) — ported from slateval's storage layer into a submodule:

store-slatedb/
  deps.edn                        ; depends on dbval via :local/root ".." + slatedb-uniffi
  src/dbval/store/slatedb.clj     ; the adapter (~130 lines)
  test/dbval/store/slatedb_test.clj

Stacked on #7 (tuple-store); retarget after it merges. Step 3 of the storage-protocol plan — after this, slateval's remaining delta is its temporal features (as-of/since/history), not storage.

Why a module (unlike the SQLite adapter)

dbval.store.slatedb :imports io.slatedb.uniffi classes, so the namespace cannot load without the jar — no requiring-resolve trick available — and slatedb-uniffi is a heavy native dependency. Consumers use it as a git dep with :deps/root "store-slatedb"; SQLite/memory users never download it.

Why the adapter is thin

SlateDB's WriteBatch is write-only — no read-your-writes — which is exactly the case the engine's pending-overlay design (from #7) was built for. The adapter only provides:

  • -scan: scanWithOptions over a KeyRange, with SlateDB's native descending iteration for reverse scans
  • -commit!: stage keys (empty values) into a WriteBatch, one atomic .write
  • plus the JNA native-library extraction workaround for the uniffi loader, taken verbatim from slateval

Notably, slateval independently evolved its own pending-writes overlay merged into slice when it ported to SlateDB — the engine-owned overlay in #7 is that same solution, generalized so every backend gets it for free.

Tests

  • Module suite (cd store-slatedb && clojure -M:test) runs the same representative flows as dbval.test.store — transact, upsert, retract history (forward + reverse scans), query, pull, index-range, snapshot isolation, failed-transaction atomicity — against SlateDB over the memory:/// object store: 2 tests, 11 assertions, 0 failures.
  • Root suite unchanged: 162 tests, 1048 assertions, 0 failures.
  • CI runs the module tests as a second step.

🤖 Generated with Claude Code

https://claude.ai/code/session_014dX8tTR4yFh5SyBGw3atpo

maxweber and others added 2 commits July 15, 2026 21:26
The first non-default `dbval.store` backend, ported from slateval's
storage layer. It lives in its own module (own deps.edn depending on
dbval via :local/root, consumable as a git dep with :deps/root) because
io.slatedb/slatedb-uniffi is a heavy native dependency and the namespace
cannot load without it — consumers on the SQLite or memory backend
should not download it.

The adapter is thin thanks to the pending-overlay design: SlateDB's
WriteBatch is write-only (no read-your-writes), which is exactly why the
engine owns transaction-read visibility — the store just scans committed
keys (native ascending/descending iteration) and commits batches
atomically.

Module tests run the same representative engine flows as
dbval.test.store against the SlateDB store over the in-memory object
store; CI runs them alongside the main suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
slatedb-uniffi is compiled to class-file version 66 (JDK 22+), so the
module cannot run on the job's Java 11 — the JVM did not even start,
since --enable-native-access does not exist there. The main suite keeps
Java 11; the module step switches to Temurin 24 and the JDK requirement
is documented in the module README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Base automatically changed from tuple-store to main July 15, 2026 19:54
@maxweber
maxweber merged commit f44bb7d into main Jul 15, 2026
1 check passed
@maxweber
maxweber deleted the slatedb-store branch July 15, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant