ol.xitstash

Binary content and file catalogs in xitdb.

doc status: experimental

ol.xitstash stores binary content alongside your application’s records in xitdb. Payloads share identical chunks, and a file catalog gives them names and directories. Use it when a record and its attachment need to commit in the same database transaction.

The library provides content hashing, optional compression and seekable streams that check bytes before returning them. Your application opens the database, starts transactions and decides when to compact it.

Requires Java 17 or later and application-supplied xitdb-java. The tested xitdb version is 0.48.0.

Project status: Experimental.

The API is provisional. There is no published artifact, and source access is restricted.

Installation

With an authorised source checkout, follow the installation instructions. There is no runtime dependency on xitdb-clj or Yggdrasil.

Quick start

Prepare bytes before starting a write transaction:

(require '[ol.xitstash :as objects])

(with-open [prepared (objects/prepare (byte-array [1 2 3]))]
  {:digest (:digest prepared) :size (:size prepared)})

Result:

{:digest "f1220039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81"
 :size 3}

Preparation computes the content ID but does not publish the bytes. Save your first file takes this through a transaction and reads it back.

Documentation

The issue tracker requires repository access.

Licensing

The project license has not yet been specified. Do not redistribute a release artifact.

The FastCDC implementation includes code adapted from xit under the MIT license. Its notice is in resources/META-INF/xit-LICENSE.txt and is included in development jars.