A database per agent: how Turso and Neon give different answers
Neon 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.
Related posts
- Building AI Agent Databases: A Complete Guide to Database-per-Agent Architecture
Turso mediumAdeptGiving each AI agent its own SQLite-style database, instead of sharing tables keyed by tenant_id or using schema-per-tenant, makes isolation, debugging and cleanup trivial: deleting an agent is a single API call. Four patterns are shown on Turso: a cloud database per agent, embedded on-device databases, embedded databases synced to the cloud via push/pull, and hub-and-spoke with a shared coordination database, plus native F32_BLOB vectors with cosine-distance search for per-agent semantic memory. Per-request billing means idle or nearly idle agent databases cost little beyond storage. The main tradeoffs are cross-agent analytics, which need fan-out queries or a separate aggregate store, and the lack of ACID guarantees across agents, so the pattern suits many agents with independent state rather than a few with heavy cross-agent queries.
- 2 million databases and counting: the architecture behind Sauna's AI teammate
Turso easyNoviceSauna, a proactive AI work assistant, gives every session, agent and connected inbox or calendar its own Turso database, creating about 90,000 databases a day and over 2 million in total. The team moved from Cloudflare Durable Objects to Containers with Litestream, which proved slow and expensive, and switched to Turso once per-database pricing was removed. Turso Sync keeps each database as a local file with two-way sync: on a conflicting pull it atomically rolls back to the last synced state, applies remote changes and replays local writes. The database-per-connection model simplifies isolation between users and lets storage outlive compute when changing hosting providers.
- Databases as Variables: What Unlimited Databases Actually Changes
Turso mediumAdeptTurso Cloud's paid plans no longer meter active databases, so a database costs only its storage while idle. That changes the cost math behind choosing a shared tenant_id schema. Because a Turso database is a file stored as 128 kB segments in object storage with copy-on-write branching, per-tenant, per-agent-session, per-experiment, per-regulated-user and per-PR databases become cheap, and provisioning takes two Platform API calls seeded from a template. Real costs remain: cross-tenant analytics pipelines (CDC helps), fleet-wide migration runners, routing and monitoring, so shared schemas still suit early, unregulated or analytics-heavy products, and a hybrid is often best.
- Inside LuBot's database-per-tenant architecture
Neon mediumAdept
LuBot, a solo-founder analytics chat product, gives each paying customer an isolated Postgres database by creating a Neon branch from a Stripe webhook, with Supabase kept as the control plane for orgs, users and billing. Branches get deterministic names so webhook retries are idempotent; the new branch is migrated, its connection URL is stored on the user row, and all access goes through a single tenant resolver function. Tenant computes autoscale from 0.25 to 4 CU and suspend after 300 seconds idle, avoiding roughly $20/month per idle tenant. Behind PgBouncer transaction-mode pooling, session settings like search_path do not persist, so set them per query or at the role level, use direct URLs for migrations, and reset connections on check-in.
- One Postgres, a database per user, or both?
Turso easyNoviceChoosing 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.