# Can you use SQLite in production for a web app?

Last updated: 2026-11-10

Yes, for most web apps that run on one machine and write less often than they read. The SQLite authors say it handles most low to medium traffic sites, and it stops fitting when several servers must write to the same database or the data heads toward terabytes. You can run it yourself on a **Hetzner** server with **Litestream** backups, inside a Workers app on **Eurobase** or **Cloudflare**, or as a network database on **Turso**.

## Ways to run SQLite in production at a glance

| Platform | Where the database lives | Who can query it | Backups | Watch out for |
|---|---|---|---|---|
| Hetzner | A file on your own server | Code on that server | Yours to set up, for example with Litestream | Cheapest plans showed as unavailable on 10 November 2026 |
| Eurobase | A SQLite database in your project | That project's apps on V8 isolates, through a binding | Not documented | No documented access from containers or outside apps |
| Cloudflare | D1, with an optional EU jurisdiction | Cloudflare Workers | Time Travel, 30 days on Workers Paid | 10 GB per database, can't be raised |
| Turso | AWS, with Ireland as the European location | Any app over the network | Point-in-time restore, 1 day on Free and 10 days on Developer | Company based in San Francisco |

Prices and limits are from each provider's own page, checked on 9 and 10 November 2026.

## What to check before choosing SQLite

- **How many machines write.** SQLite allows any number of readers but one writer at a time per database file. Writers queue, and SQLite's docs say a lock rarely lasts more than a few dozen milliseconds, so one app server is usually fine. Several servers writing the same file is not.
- **Whether the code and the file share a disk.** WAL mode, the journal you want for a website, needs every process on the same host and doesn't work over a network filesystem. A database on NFS or a shared volume is the classic way to corrupt one.
- **How write-heavy the traffic is.** The SQLite site suggests a client/server database for sites that are write-intensive or busy enough to need several servers.
- **How large the data will get.** The format allows up to 281 TB, but the SQLite authors suggest looking at a client/server engine once the data might reach the terabyte range.
- **Whether you can split the data.** One database per customer or per project spreads the single-writer limit across many files. Cloudflare designs D1 around this pattern.

## The settings that make it production-ready

On your own server, three settings do most of the work.

1. Turn on WAL with `PRAGMA journal_mode=WAL`. Readers stop blocking the writer, and the writer stops blocking readers.
2. Set `PRAGMA synchronous=NORMAL`. SQLite calls this the best balance for most apps in WAL mode: the database stays consistent, but a transaction committed just before a power cut or OS crash can be rolled back. Keep `FULL` if every committed write must survive that.
3. Set a `busy_timeout` such as 5,000 ms, so a request waits for the writer instead of failing at once with `SQLITE_BUSY`. SQLite's docs warn that WAL can still return busy in rare cases, so handle the error.

Keep transactions short, never hold one open across a network call, and add indexes before you blame the engine.

## Frameworks now expect it

Rails 8 can run its job queue, cache and WebSocket pub/sub on SQLite through Solid Queue, Solid Cache and Solid Cable, so a single-server Rails app no longer needs Redis or Postgres to start. That's a sign of how far the single-server pattern has come, not a promise that it scales to many servers.

## 1. Hetzner

Put the app and its SQLite file on one virtual server in Germany or Finland. The smallest Hetzner cloud server, a CPX02, is listed at €5.49 a month excl. VAT in Helsinki and €6.49 in Falkenstein or Nuremberg, but those entry plans showed as unavailable to order on 10 November 2026. Add Litestream, which runs as a separate background process, copies WAL pages to object storage as they're written, and can restore the database to a chosen transaction or point in time. It sends each database to one replica destination, and its guides cover S3-compatible stores such as Scaleway Object Storage. For a European bucket, see [European object storage](/i/european-object-storage).

- **Best for:** Rails, Laravel, Go or Node.js apps on one server, with someone who can patch it.
- **Price:** the server, plus a few cents of object storage for backups.
- **What it lacks:** failover. If the server dies, you restore to a new one from the replica.

## 2. Eurobase

On Eurobase, SQLite comes as D1-compatible databases for apps that run on V8 isolates, such as Hono, Astro or Next.js. You declare them in your Wrangler config, one database per `d1_databases` entry. A rollback reads and writes the same data and schema as the deployment it replaces, and the numbered SQL files in your migrations folder run once each, in order, when a deployment activates. If one fails, the deployment fails with SQLite's own error and the previous one keeps serving. Behind it is a business registered in Warsaw, Poland, and the databases sit on European infrastructure run by Scaleway, a French provider.

- **Best for:** Workers-style apps and APIs that want a database with no server to manage. Start from the [Hono guide](/docs/guides/hono) or the [Workers docs](/docs/workers).
- **Price:** no separate database fee is listed. The workspace plans are Free, Starter at €10 and Pro at €20 a month + VAT per workspace. There are no usage charges today: work over a limit is refused, apps on V8 isolates and Functions stop until the monthly reset, and containers and static sites keep serving.
- **What it lacks:** a documented way to reach the database from containers or from outside the project, and managed Postgres or MySQL. Container apps scale to zero when idle, so don't keep a SQLite file inside one. ISO 27001 and SOC 2 are still in progress.

## 3. Cloudflare

D1 is Cloudflare's SQLite for Workers. You can set an EU jurisdiction when you create a database, and Workers Paid starts at $5 a month. Each database is single-threaded, so throughput follows query time: Cloudflare's own example is about 1,000 queries a second at 1 ms each. A database holds up to 10 GB on Workers Paid and 500 MB on Free.

- **Best for:** apps already on Cloudflare that can split data into many small databases.
- **Price:** free with daily limits, then Workers Paid.
- **What it lacks:** a way past 10 GB per database, and the EU jurisdiction doesn't stop Workers elsewhere in the world from querying it.

## 4. Turso

Turso serves SQLite over the network, so an app on any host can use it, and its Free plan includes 100 databases. Turso announced on 2 October 2026 that Supabase is acquiring it.

- **Best for:** apps that can't keep the database file next to the code.
- **Price:** free, then $4.99 a month for Developer on yearly billing.
- **What it lacks:** a European location other than AWS in Ireland. For more options, see [Turso alternatives](/i/turso-alternatives).

## How to choose

- One server, one app, mostly reads: SQLite on your own server with WAL and Litestream.
- An app on V8 isolates that you'd rather not babysit: Eurobase or Cloudflare D1, with the trade-offs in [serverless SQLite in Europe](/i/serverless-sqlite-europe).
- Several app servers writing at once, heavy writes, or shared reporting access: Postgres. See [managed Postgres in Europe](/i/managed-postgres-europe).

## Frequently asked questions

### How much traffic can SQLite handle?

The SQLite authors call 100,000 hits a day a conservative figure for a website and say it has been shown to work at ten times that. Their own site served about 400,000 to 500,000 requests a day on a single shared VM when they measured it in 2015. What matters more than visits is how many writes each request makes.

### Can two servers share one SQLite file?

Not safely. WAL needs every process on the same host, and SQLite's docs say locking has worked incorrectly on some network filesystems, which has led to corrupted databases. Keep one server per database, or move to a client/server engine.

### How do I back up a SQLite database that's in use?

Don't copy the file with `cp` while the app writes. Use the online backup API, `VACUUM INTO` to write a clean copy, or `sqlite3_rsync` to copy it to another machine over SSH. For continuous backups, Litestream streams changes to object storage.

### Will I lose data with synchronous=NORMAL?

The database won't corrupt, and transactions survive an application crash. A power loss or OS crash can roll back the last commits, so choose `FULL` if those writes can't be lost.

### When should I move from SQLite to Postgres?

When you need a second app server that writes, when writes queue long enough to slow requests, or when other tools need to query the data directly. The [SQLite vs Postgres](/blog/sqlite-vs-postgres) post covers the switch in more depth.

## Sources

- [SQLite: Appropriate uses for SQLite](https://www.sqlite.org/whentouse.html)
- [SQLite: Write-ahead logging](https://www.sqlite.org/wal.html)
- [SQLite: PRAGMA statements](https://www.sqlite.org/pragma.html)
- [SQLite: Backup API](https://www.sqlite.org/backup.html)
- [SQLite over a network](https://www.sqlite.org/useovernet.html)
- [SQLite limits](https://www.sqlite.org/limits.html)
- [Litestream: How it works](https://litestream.io/how-it-works/) and [Replicating to Scaleway Object Storage](https://litestream.io/guides/scaleway/)
- [Rails 8: No PaaS required](https://rubyonrails.org/2024/11/7/rails-8-no-paas-required)
- [Cloudflare D1 limits](https://developers.cloudflare.com/d1/platform/limits/), [D1 Time Travel](https://developers.cloudflare.com/d1/reference/time-travel/), [D1 data location](https://developers.cloudflare.com/d1/configuration/data-location/), [D1 pricing](https://developers.cloudflare.com/d1/platform/pricing/) and [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/)
- [Turso pricing](https://turso.tech/pricing) and [Turso locations](https://docs.turso.tech/api-reference/locations)
- [Hetzner Cloud](https://www.hetzner.com/cloud/)
- [Eurobase Workers docs](/docs/workers), [Containers docs](/docs/containers) and [plans](/docs/plans)
