blocks.store.file

File stores provide block storage backed by a local filesystem. Each block is stored in a separate file under the root. File block stores may be constructed using a file://<path-to-root-dir> URI. Both relative and absolute paths are supported.

Under the root directory, the store keeps a block data in a subdirectory alongside some layout metadata and a landing directory:

$ROOT/meta.properties
$ROOT/blocks/111497df/35011497df3588b5a3...
$ROOT/landing/block.123456789.tmp

In many filesystems, performance degrades as the number of files in a directory grows. In order to reduce this impact and make navigating the blocks more efficient, block files are stored in multiple subdirectories consisting of the four byte prefix of the hashes of the blocks stored in them. Within each directory, blocks are stored in files whose names consist of the rest of their id digest.

In addition to the blocks, a meta.properties file at the root holds information about the current storage layout for future-proofing. This currently holds a single layout version property, which is always "v1".

file-block-store

(file-block-store root & {:as opts})

Creates a new local file-based block store.

layout-version

The current supported storage layout version.