One Postgres, a database per user, or both?
Choosing between one Postgres database, a Turso database per user, or both comes down to where data must live, who owns it, and how many features need to read across users. Early-stage web apps default to a single Supabase Postgres with row-level security and a self-hosting exit. Local-first apps like Sample Vault give each user a Turso database synced to their machine, which provides isolation by construction and data ownership if the product disappears. Hybrid apps use Supabase to govern accounts, auth and storage while per-user Turso databases hold user data. Because database-per-user is "a bet against cross-user features", teams should list every cross-user read before adopting it; the agent delegation case shows the cost, since delegated tasks must be copied into a central database.
Related posts
- Multi-tenancy and Database-per-User Design in Postgres
Neon easyNovice
Postgres multi-tenancy comes in three main designs: shared schema, schema-per-user and database-per-user. Shared schema is cheapest but raises the risk and impact of isolation failures. Schema-per-user adds operational burden without strong isolation and is rarely worth it today. Database-per-user gives full isolation, data residency control and a fix for noisy neighbors, and it can pair with either isolated or shared application environments, each with tradeoffs in onboarding, versioning and complexity. Running it at scale requires a control plane to automate onboarding, monitoring and schema upgrades across the database fleet.
- Database-per-User Architecture With Shared Application Environments: How and Why
Neon mediumAdept
A single shared application environment serving many per-customer Neon Postgres databases keeps deployment simple, but every tenant database must stay at the same schema version and data residency is hard to offer. Tenant identification can come from a login field, a per-customer subdomain, or a lookup from the user's credentials. A catalog database maps users or JWT-carried customer IDs to Neon project IDs for connection routing, and it also holds tier and feature-flag context. Schema changes need either slow, backward-compatible rollouts using views and triggers, or pre-upgrade testing of each tenant database on branches. The control plane should be kept separate from the app so failures don't take both down.
- A database per agent: how Turso and Neon give different answers
Turso easyNoviceNeon and Turso both support a database per agent but differ in the unit: Neon gives each agent a Postgres project with its own autoscaling compute that suspends after 5 minutes idle and is billed by CU-hour, while Turso treats each SQLite-compatible database as a file managed by a shared server, billed by rows read/written and storage with unlimited databases on paid plans. For bursty agent workloads with many mostly idle databases, Turso avoids per-database compute clocks and adds per-database BYOK encryption, BYOC, on-device sync, and BEGIN CONCURRENT writes (about 9,500 TPS at 64 connections in 0.8). Neon remains better for branching a full production backend per agent, and Supabase Postgres is the recommended fit for Postgres-specific needs or storage-heavy, rarely queried data.
- The Many-Database Architecture: Should You Give Every Tenant Their Own Database?
Turso mediumAdeptShared schema with row-level security, schema per tenant, and database per tenant trade off isolation strength against operational cost. Shared schema stays simplest for many small tenants and cross-tenant analytics, but its isolation is only logical. Schema-per-tenant takes on most of the overhead of separate databases for only part of the isolation. Database-per-tenant gives structural isolation, trivial per-tenant deletion and placement in a chosen region. Cheap SQLite-based databases make it affordable, though routing, monitoring and cross-tenant analytics (via ETL or CDC) become operational work. A TypeScript example shows provisioning from a template database and scoping tokens per tenant.
- Multi-tenancy at Scale: How to Give Every User Their Own Database
Turso mediumAdeptThe standard warning against database-per-tenant assumes each database is a server process like PostgreSQL or MySQL, with its own memory, connection pool and backup schedule. When a database is a SQLite file, an idle tenant costs only storage, so 1,000 tenant databases fit in a ~$25/month Turso plan instead of five figures on RDS. Per-tenant databases replace Row-Level Security and `tenant_id` filtering with routing to the right database. That makes isolation, BYOK encryption, regional data residency and GDPR deletion architectural properties. The costs are harder cross-tenant analytics, coordinated schema migrations across the fleet, and a poor fit for consumer apps with millions of tiny users or products needing constant cross-tenant queries.