# TinyStore documentation

TinyStore gives an application SQL databases, key-value state, background
jobs, files, search, channels, locks, settings, logs and metrics in one
directory on its own disk. The core is written in Rust. Rust programs call it
directly, and Bun, Node, Python and Go programs reach the same core through
their SDK.

The documentation has three parts, each for a different moment:

- **[Learn from scratch](https://tinyshed.org/tinystore/docs/handbook)**: the Handbook builds one
  application, an AI chat, chapter by chapter, from a first store to copies
  in another region, and explains why TinyStore is built the way it is.
- **[Explore the engines](https://tinyshed.org/tinystore/docs/guides)**: the Guides cover each engine,
  a page per feature, for when you know what you need: expiry in KV, retries
  in Jobs, filters in Search.
- **[Browse the API](https://tinyshed.org/tinystore/docs/reference/api)**: the Reference lists every call of
  every SDK, generated from the source.

Every example is shown in TypeScript, Python, Go and Rust.

## Handbook

### Start

- [Learn TinyStore](https://tinyshed.org/tinystore/docs/handbook)
- [Why TinyStore](https://tinyshed.org/tinystore/docs/handbook/start/why)
- [Your first store](https://tinyshed.org/tinystore/docs/handbook/start/first-store)
- [One directory, many engines](https://tinyshed.org/tinystore/docs/handbook/start/directory)
- [The chat we build](https://tinyshed.org/tinystore/docs/handbook/start/chat)

### Building the chat

- [Messages](https://tinyshed.org/tinystore/docs/handbook/chat/messages)
- [Sessions and limits](https://tinyshed.org/tinystore/docs/handbook/chat/sessions-and-limits)
- [Replies in the background](https://tinyshed.org/tinystore/docs/handbook/chat/replies)
- [Attachments](https://tinyshed.org/tinystore/docs/handbook/chat/attachments)
- [Finding old messages](https://tinyshed.org/tinystore/docs/handbook/chat/finding-old-messages)
- [Live updates](https://tinyshed.org/tinystore/docs/handbook/chat/live-updates)
- [Settings](https://tinyshed.org/tinystore/docs/handbook/chat/settings)
- [What it is doing](https://tinyshed.org/tinystore/docs/handbook/chat/what-it-is-doing)
- [How fast it is](https://tinyshed.org/tinystore/docs/handbook/chat/how-fast-it-is)
- [Keeping it](https://tinyshed.org/tinystore/docs/handbook/chat/keeping-it)

### Under the hood

- [The journey of a write](https://tinyshed.org/tinystore/docs/handbook/inside/journey-of-a-write)
- [SQLite as TinyStore runs it](https://tinyshed.org/tinystore/docs/handbook/inside/sqlite)
- [One budget of memory](https://tinyshed.org/tinystore/docs/handbook/inside/memory)
- [Time and errors](https://tinyshed.org/tinystore/docs/handbook/inside/time-and-errors)
- [How a job lives](https://tinyshed.org/tinystore/docs/handbook/inside/how-a-job-lives)
- [How logs and metrics pack](https://tinyshed.org/tinystore/docs/handbook/inside/how-logs-and-metrics-pack)
- [How search finds](https://tinyshed.org/tinystore/docs/handbook/inside/how-search-finds)
- [One core, four languages](https://tinyshed.org/tinystore/docs/handbook/inside/one-core)

### Beyond one machine

- [The server](https://tinyshed.org/tinystore/docs/handbook/nodes/server)
- [Readers in another region](https://tinyshed.org/tinystore/docs/handbook/nodes/copies)
- [When the home dies](https://tinyshed.org/tinystore/docs/handbook/nodes/home-dies)

### Production

- [What TinyStore promises](https://tinyshed.org/tinystore/docs/handbook/production/promises)
- [Limits and defaults](https://tinyshed.org/tinystore/docs/handbook/production/limits)
- [Running it](https://tinyshed.org/tinystore/docs/handbook/production/running-it)

## Guides

### Engines

- [All engines](https://tinyshed.org/tinystore/docs/guides)
- [Connecting](https://tinyshed.org/tinystore/docs/guides/connecting)

### SQL

- [Overview](https://tinyshed.org/tinystore/docs/guides/sql)
- [Migrations](https://tinyshed.org/tinystore/docs/guides/sql/migrations)
- [Writes and transactions](https://tinyshed.org/tinystore/docs/guides/sql/writes)
- [Tables and queries](https://tinyshed.org/tinystore/docs/guides/sql/tables)
- [Rows that include rows](https://tinyshed.org/tinystore/docs/guides/sql/include)
- [Buckets and queues in a database](https://tinyshed.org/tinystore/docs/guides/sql/buckets-and-queues)
- [FTS5 and R\*Tree](https://tinyshed.org/tinystore/docs/guides/sql/fts5)

### KV

- [Overview](https://tinyshed.org/tinystore/docs/guides/kv)
- [Expiry](https://tinyshed.org/tinystore/docs/guides/kv/expiry)
- [Versions](https://tinyshed.org/tinystore/docs/guides/kv/versions)
- [Branches](https://tinyshed.org/tinystore/docs/guides/kv/branches)
- [Encrypted buckets](https://tinyshed.org/tinystore/docs/guides/kv/encrypted)
- [Counters](https://tinyshed.org/tinystore/docs/guides/kv/counters)
- [Rate limits](https://tinyshed.org/tinystore/docs/guides/kv/rate-limits)
- [Quotas](https://tinyshed.org/tinystore/docs/guides/kv/quotas)
- [Once](https://tinyshed.org/tinystore/docs/guides/kv/once)
- [Transactions](https://tinyshed.org/tinystore/docs/guides/kv/transactions)

### Jobs

- [Overview](https://tinyshed.org/tinystore/docs/guides/jobs)
- [Ids](https://tinyshed.org/tinystore/docs/guides/jobs/ids)
- [Schedules and cron](https://tinyshed.org/tinystore/docs/guides/jobs/schedules)
- [Concurrency and rate](https://tinyshed.org/tinystore/docs/guides/jobs/concurrency)
- [Watching a job](https://tinyshed.org/tinystore/docs/guides/jobs/watching)
- [Steps](https://tinyshed.org/tinystore/docs/guides/jobs/steps)
- [Jobs in your database](https://tinyshed.org/tinystore/docs/guides/jobs/your-database)
- [Testing](https://tinyshed.org/tinystore/docs/guides/jobs/testing)

### Blobs

- [Overview](https://tinyshed.org/tinystore/docs/guides/blobs)
- [Uploads](https://tinyshed.org/tinystore/docs/guides/blobs/uploads)
- [Serving files](https://tinyshed.org/tinystore/docs/guides/blobs/serving)
- [Copies and expiry](https://tinyshed.org/tinystore/docs/guides/blobs/copies-and-expiry)
- [Integrity](https://tinyshed.org/tinystore/docs/guides/blobs/integrity)

### Search

- [Overview](https://tinyshed.org/tinystore/docs/guides/search)
- [Fields and weights](https://tinyshed.org/tinystore/docs/guides/search/fields)
- [Typos](https://tinyshed.org/tinystore/docs/guides/search/typos)
- [Filters](https://tinyshed.org/tinystore/docs/guides/search/filters)
- [Vectors](https://tinyshed.org/tinystore/docs/guides/search/vectors)
- [Words and vectors together](https://tinyshed.org/tinystore/docs/guides/search/hybrid)
- [A table's index](https://tinyshed.org/tinystore/docs/guides/search/table-index)
- [Rebuilds](https://tinyshed.org/tinystore/docs/guides/search/rebuilds)

### Channels

- [Overview](https://tinyshed.org/tinystore/docs/guides/channels)
- [Subscriptions and missed messages](https://tinyshed.org/tinystore/docs/guides/channels/subscriptions)
- [Publishing from a transaction](https://tinyshed.org/tinystore/docs/guides/channels/transactions)

### Locks

- [Overview](https://tinyshed.org/tinystore/docs/guides/locks)
- [Holding and waiting](https://tinyshed.org/tinystore/docs/guides/locks/holding)
- [Leases over a connection](https://tinyshed.org/tinystore/docs/guides/locks/leases)
- [Fences](https://tinyshed.org/tinystore/docs/guides/locks/fences)
- [Semaphores](https://tinyshed.org/tinystore/docs/guides/locks/semaphores)

### Config

- [Overview](https://tinyshed.org/tinystore/docs/guides/config)
- [Layers and files](https://tinyshed.org/tinystore/docs/guides/config/layers)
- [Secrets and required settings](https://tinyshed.org/tinystore/docs/guides/config/secrets)
- [Live settings](https://tinyshed.org/tinystore/docs/guides/config/live)
- [Watching](https://tinyshed.org/tinystore/docs/guides/config/watching)
- [Explain and validate](https://tinyshed.org/tinystore/docs/guides/config/explain)

### Records

- [Overview](https://tinyshed.org/tinystore/docs/guides/records)
- [Logging](https://tinyshed.org/tinystore/docs/guides/records/logging)
- [Console output](https://tinyshed.org/tinystore/docs/guides/records/console)
- [Events](https://tinyshed.org/tinystore/docs/guides/records/events)
- [Reading](https://tinyshed.org/tinystore/docs/guides/records/reading)
- [Traces](https://tinyshed.org/tinystore/docs/guides/records/traces)
- [Tail and poll](https://tinyshed.org/tinystore/docs/guides/records/tail-and-poll)
- [Other programs' output](https://tinyshed.org/tinystore/docs/guides/records/other-programs)
- [Repair](https://tinyshed.org/tinystore/docs/guides/records/repair)

### Metrics

- [Overview](https://tinyshed.org/tinystore/docs/guides/metrics)
- [Instruments](https://tinyshed.org/tinystore/docs/guides/metrics/instruments)
- [Reading](https://tinyshed.org/tinystore/docs/guides/metrics/reading)
- [Aggregates](https://tinyshed.org/tinystore/docs/guides/metrics/aggregates)
- [Ingesting](https://tinyshed.org/tinystore/docs/guides/metrics/ingesting)
- [The store's own metrics](https://tinyshed.org/tinystore/docs/guides/metrics/self-metrics)
- [The metrics crate](https://tinyshed.org/tinystore/docs/guides/metrics/metrics-crate)

### Backup

- [Overview](https://tinyshed.org/tinystore/docs/guides/backup)
- [Restore](https://tinyshed.org/tinystore/docs/guides/backup/restore)
- [The encryption key](https://tinyshed.org/tinystore/docs/guides/backup/encryption-key)

### Command line

- [Overview](https://tinyshed.org/tinystore/docs/guides/cli)
- [serve](https://tinyshed.org/tinystore/docs/guides/cli/serve)
- [status and logs](https://tinyshed.org/tinystore/docs/guides/cli/status-and-logs)
- [kv, sql and schema](https://tinyshed.org/tinystore/docs/guides/cli/kv-sql-schema)
- [Backup and restore](https://tinyshed.org/tinystore/docs/guides/cli/backup)
- [Nodes](https://tinyshed.org/tinystore/docs/guides/cli/nodes)
- [AI agents](https://tinyshed.org/tinystore/docs/guides/cli/mcp)

## Reference

- [API reference](https://tinyshed.org/tinystore/docs/reference/api)
- [Wire protocol](https://tinyshed.org/tinystore/docs/wire)
