Storh

storh

storh is a standalone PHP datastore built around files: JSONC documents, an append-only segmented log, and an append-only queue. It stores records with UUIDv7 ids, supports streaming reads and cursor or time-range queries, and uses atomic filesystem operations instead of a database server.

Callers provide a directory. storh does not discover application paths, read global constants, or require a framework adapter.

Engines

  • DocStore stores one JSONC file per record with UUID-tail-sharded paths. Best for point reads by id and indexed field queries.
  • SegmentedLog appends length and checksum guarded records to NDJSON segments. Best for append-heavy streams with cursor and time-range reads.
  • Queue appends durable job events and keeps queue state in memory. Best for durable work dispatch between processes.

Unsure which one fits your workload? See Choosing an engine for a side-by-side comparison.

The extracted class names remain available as DocPerFileStore, SegmentedLogStore, and LogQueue.

Requirements

  • PHP 8.2 or later
  • ext-json
  • a local or mounted filesystem with atomic rename semantics inside a directory

Where to next

On this page