TinyStore
A small storage runtime for applications. SQL, key-value state, durable jobs, files, search, logs and metrics in one directory, with one lifecycle, one memory budget and one backup. SQLite is underneath, and a Rust program compiles all of it in: the program is the store.
Not released yet. Until
v0.1.0, the API, the files and the protocol change freely, and a store written by one build may not open in the next.
TinyStore builds SQLite itself, with flags of its own. Put them in your
project's .cargo/config.toml, since a dependency cannot set them for you:
[]
= "SQLITE_DQS=0 -USQLITE_ENABLE_MEMORY_MANAGEMENT SQLITE_ENABLE_DBPAGE_VTAB"
Without them readers wait on one another, which the store logs once when it opens, and a node of a replicated store cannot apply its home's pages.
use ;
let store = open?;
let db = store.database.migrations.open?;
db.exec?;
let sessions = store..idle.open?;
sessions.set?;
let emails = store..open?;
emails.add?;
Each engine is a cargo feature, all of them on by default: kv, config,
locks, channels, jobs, sql, blobs, records, metrics, system,
search, backup, replication and wire, with replication-tls and
console beside them. A program that turns the defaults off links only the
engines it names.
- Your first store: a first program, step by step
- The guides: every engine, page by page, in Rust, TypeScript, Python and Go
- The
tinystorecommand: a store's directory served to other processes, and read while it runs
Licensed under Apache-2.0.