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 whose conversation another machine resumes.
- A database per agent, task or tenant
Created and deleted through the API (see One database per agent run).
- A call made once
An email or a payment recorded before it is made (see Run side effects once).
- 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).
- 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).
- Edge runtimes, browsers, and languages other than Node.js and Python.
- Opening its files with other SQLite tools: export a copy 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 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.
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 and Python, and the regions under Regions and URLs.
Get started
- Quickstart: SQLite/Node.jsSign in, create a database and make a first replicated commit with
node:sqlite, from your laptop. - Quickstart: SQLite/PythonThe same from Python, with its own
sqlite3, from your laptop. - Quickstart: Drizzle ORMDefine a schema, run its migration in the app and query a database with Drizzle.
- Quickstart: Pi DurableRun a Pi Durable Harness whose conversation another machine can resume.
Next steps
- ConceptsThe words the rest of these pages use: the local copy, a commit, synced(), the writer.
- Connect from Node.jsOpen a database from your Node.js program, and await
synced()before anything outside the process acts on a commit. - Connect from PythonThe same from Python: open a database by its URL, and call
synced()before anything outside the process acts on a commit. - Rules for databasesWhat to do and what not to, for safe data, one writer and a small bill.
- GuaranteesWhen a commit is durable, and what happens when the program moves, runs twice or goes offline.
- LimitsHow large a transaction and a database can be, requests per second, and databases per account.
- PricingWhat writes and storage cost, with worked examples.