The database for a multi-tenant SaaS
Postgres meets the needs that matter most for 200 business customers: isolation the database enforces, failover, and reporting. Switch on what you need; the options that cannot give it fade.
| Option | Isolation enforced by the database | Failover without a restore | Reporting on live data | Transactional migrations | Least to operate |
|---|---|---|---|---|---|
| Postgres | Yesrow-level security | Yesmanaged standby | Yesmaterialized views, replicas | YesDDL inside a transaction | Partialmanaged service |
| MySQL | Notenant filter in app code | Yesmanaged standby | Partialno materialized views | NoDDL commits implicitly | Partialmanaged service |
| SQLite + Litestream | Partialone file per tenant | Norestore on a new host | Partialshares the app's host | YesDDL inside a transaction | Yesruns inside the app |
| SQLite on Turso | Partialdatabase per tenant | Partialhosted, read the SLA | Partialremote, thin tooling | YesDDL inside a transaction | Yeshosted |
Load does not decide
Each option handles a small SaaS's writes on one machine. Move the sliders to see how far the load has to grow before SQLite's single writer is the limit.
GuessedCeilings are planning figures for small commits on a cloud SSD (SQLite in WAL mode, a modest Postgres or MySQL instance), not benchmarks. Measure your own workload before relying on them.
What a failed host costs
The options differ in what happens when the machine dies, not in how fast they run.
Postgres and MySQL keep a standby that takes over. Litestream keeps a continuous backup, so a host failure means a restore, and writes after the last sync are lost (Litestream). On Turso, the vendor runs the replication; read its terms for what it promises.
How would isolation work with one database per tenant?
Each customer gets its own SQLite file or Turso database, so one tenant can never read another's rows, and a customer's data is easy to export or delete. The cost is operational: every migration runs 200 times, and reports across customers need a separate store.
Postgres and MySQL can also give each tenant a schema, with the same migration cost. Postgres's row-level security keeps one shared schema and still has the database refuse cross-tenant reads (PostgreSQL docs).
Pick a database
Postgres is recommended: it is the only option here that meets isolation, failover and migrations without a compromise. Switch to SQLite if a restore after an outage and a single host are acceptable for the first year.
Basis
The matrix is the page's own reading of the documentation: row-level security in Postgres, implicit commits in MySQL, SQLite's one writer in WAL mode, when SQLite fits, Litestream and Turso. Product features change; check the version you will run.