> Fetch the index of every Tonbo docs page as Markdown at https://tonbo.dev/llms.txt

# Databases

Last updated 29 October 2026

SQLite databases your program opens by name from any machine: statements run on a local copy at the speed of SQLite, and when the machine goes away, another one opens the database and carries on.

## What people build with it

- An agent that outlives its sandbox

  The next process opens the same database by name and finds every confirmed commit.
- A durable agent harness

  A [Pi Durable Harness](https://tonbo.dev/docs/getting-started/quickstarts/pi.md) whose conversation another machine resumes.
- A database per agent, task or tenant

  Created and deleted through the API (see [One database per agent run](https://tonbo.dev/docs/databases/per-run.md)).
- A call made once

  An email or a payment recorded before it is made (see [Run side effects once](https://tonbo.dev/docs/databases/side-effects.md)).
- A service without a database server

  SQL at local speed in a Node.js or Python program, kept when it moves.

## A good fit, and not

A good fit:

- One process writing each database at a time: an agent, a worker, one tenant’s instance.
- A Node.js or Python program with a local disk, short-lived ones included (see [Short-lived processes](https://tonbo.dev/docs/databases/cold-starts.md#short-lived)).
- Many small databases, each up to 256 MiB compressed.

Not a good fit:

- Many processes writing one database at once (see [When two instances run](https://tonbo.dev/docs/databases/how-it-works.md#takeover)).
- Edge runtimes, browsers, and languages other than Node.js and Python.
- Opening its files with other SQLite tools: [export a copy](https://tonbo.dev/docs/databases/backups.md#export) instead.

## Compared with other kinds of database

|  | Tonbo Databases | A hosted Postgres | A SQLite file on a disk |
| --- | --- | --- | --- |
| Where statements run | On your machine, on a local copy | On the server, a round trip each | On your machine |
| When the machine is lost | Another opens the database; every commit `synced()` confirmed is there | Clients reconnect to the server | The data goes with the disk |
| Writers | One process at a time | Many connections | The processes of one machine |
| You pay for | Writes and storage; reads are free | Usually a server by the hour | Your own disk |

For history that only grows and that many programs read, use a [stream](https://tonbo.dev/docs/streams.md) instead.

## What it costs

Every account gets $5 of usage free each month. After that you pay for writes and storage, and reads are free. See [Pricing](https://tonbo.dev/docs/databases/pricing.md).

## Where it runs

Your program runs wherever you run it, from a laptop to a serverless function, and reaches Tonbo over HTTPS with an API key. The exact versions and platforms are under [Node.js](https://tonbo.dev/docs/databases/connect.md#requirements) and [Python](https://tonbo.dev/docs/databases/python.md#requirements), and the regions under [Regions and URLs](https://tonbo.dev/docs/databases/manage.md#regions).

## Get started

- [Quickstart: SQLite/Node.js](https://tonbo.dev/docs/getting-started/quickstarts/sqlite.md): Sign in, create a database and make a first replicated commit with `node:sqlite`, from your laptop.
- [Quickstart: SQLite/Python](https://tonbo.dev/docs/getting-started/quickstarts/sqlite-python.md): The same from Python, with its own `sqlite3`, from your laptop.
- [Quickstart: Drizzle ORM](https://tonbo.dev/docs/getting-started/quickstarts/drizzle.md): Define a schema, run its migration in the app and query a database with Drizzle.
- [Quickstart: Pi Durable](https://tonbo.dev/docs/getting-started/quickstarts/pi.md): Run a Pi Durable Harness whose conversation another machine can resume.

## Next steps

- [Concepts](https://tonbo.dev/docs/databases/concepts.md): The words the rest of these pages use: the local copy, a commit, synced(), the writer.
- [Connect from Node.js](https://tonbo.dev/docs/databases/connect.md): Open a database from your Node.js program, and await `synced()` before anything outside the process acts on a commit.
- [Connect from Python](https://tonbo.dev/docs/databases/python.md): The same from Python: open a database by its URL, and call `synced()` before anything outside the process acts on a commit.
- [Rules for databases](https://tonbo.dev/docs/databases/rules.md): What to do and what not to, for safe data, one writer and a small bill.
- [Guarantees](https://tonbo.dev/docs/databases/how-it-works.md): When a commit is durable, and what happens when the program moves, runs twice or goes offline.
- [Limits](https://tonbo.dev/docs/databases/limits.md): How large a transaction and a database can be, requests per second, and databases per account.
- [Pricing](https://tonbo.dev/docs/databases/pricing.md): What writes and storage cost, with worked examples.
