Self-hosted SQL databases, one per user, tenant or agent.
Resta is an open-source server you run yourself. Your backend creates a database in one API call, your app queries it with the Turso client libraries, and idle databases cost only disk.
- MIT licensed
- 1 Docker Compose file
- SQLite dialect and file format
# create a database for a new customer
curl -X POST https://db.example.com/v1/databases \
-H "Authorization: Bearer $RESTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "acme"}' import { connect } from '@tursodatabase/serverless';
const db = connect({ url, authToken });
await db.all('SELECT * FROM invoices'); Why one database per tenant
Split data by the boundary it already has. Each database is its own SQLite-format file.
- Isolation without filters
- A query can only see one customer’s data, because that is all the database holds. No
WHERE tenant_id = ?to forget. - Lifecycle per customer
- Back up, restore, export or delete one customer at a time. A restore never rolls back anyone else.
- Writes that don’t queue
- Each database has its own writer, so a busy tenant doesn’t block the rest.
How it runs
Five containers behind one domain. Your data stays in Docker volumes on your server.
- API
POST /v1/databasescreates a database. It costs a directory on disk until first written. - Token
Mint a token for one database: read-only or read/write, expiring in minutes or days.
- Query
Apps send SQL to
/db/<id>. It opens on first use and closes after 5 minutes idle. - Backup
Changed databases are snapshotted hourly to a volume or an S3-compatible bucket.
Install
One Docker Compose file. On Coolify, set a domain and deploy; anywhere else, fill in .env and run docker compose up -d.
The repository is being prepared for its first public release. The install command will be here. Until then, the Coolify and Docker guides describe exactly what it will be.
| Backups | hourly, 72 kept |
|---|---|
| Database size limit | 1 GiB |
| Open at once | 10,000 |
| Statement timeout | 5 seconds |
| Longest token | 30 days |
Where it fits
Resta is for data that splits into many independent databases, on a server you control.
| Resta | SQLite in your app | One shared Postgres | |
|---|---|---|---|
| Where it runs | Your server, Docker | Inside your app process | Your server or a cloud |
| Reached over | HTTPS with tokens | Local file | Postgres protocol |
| Unit of isolation | A database per tenant | A file | Rows, schemas or policies |
| Create a tenant | One API call | Create a file | Insert rows or a schema |
| Restore one tenant | Built in | Copy a file | Manual |
| Cross-tenant queries | No | No | Yes |
Questions
What is Resta?
Resta is an open-source, self-hosted server that runs many small SQL databases, one per user, tenant, agent or task. You create databases through an HTTP API and query them with the Turso client libraries.
Is Resta free?
Yes. Resta is MIT-licensed. You pay only for the server you run it on; there is no hosted Resta service.
How is it different from Turso?
Resta uses the open-source Turso engine and speaks the same HTTP protocol as Turso’s serverless driver, but you host it yourself. Resta is not affiliated with Turso.
Does it run on Coolify?
Yes. Resta ships one Docker Compose file that uses Coolify’s generated domain and password variables. It also runs with plain docker compose on any server.
Is it production-ready?
Not yet. Resta has not had its first public release, and the Turso engine is pre-1.0. Keep backups off the server.